MCPcopy
hub / github.com/sveltejs/svelte / decrement

Method decrement

packages/svelte/src/internal/client/reactivity/batch.js:796–819  ·  view source on GitHub ↗

* @param {boolean} blocking * @param {Effect} effect

(blocking, effect)

Source from the content-addressed store, hash-verified

794 * @param {Effect} effect
795 */
796 decrement(blocking, effect) {
797 this.#pending -= 1;
798
799 if (blocking) {
800 let blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;
801
802 if (blocking_pending_count === 1) {
803 this.#blocking_pending.delete(effect);
804 } else {
805 this.#blocking_pending.set(effect, blocking_pending_count - 1);
806 }
807 }
808
809 if (this.#decrement_queued) return;
810 this.#decrement_queued = true;
811
812 queue_micro_task(() => {
813 this.#decrement_queued = false;
814
815 if (this.linked) {
816 this.flush();
817 }
818 });
819 }
820
821 /**
822 * @param {Set<Effect>} dirty_effects

Callers 1

increment_pendingFunction · 0.80

Calls 5

flushMethod · 0.95
queue_micro_taskFunction · 0.90
setMethod · 0.65
getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected