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

Function sync

packages/svelte/src/store/shared/index.js:143–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 let pending = 0;
142 let cleanup = noop;
143 const sync = () => {
144 if (pending) {
145 return;
146 }
147 cleanup();
148 const result = fn(single ? values[0] : values, set, update);
149 if (auto) {
150 set(result);
151 } else {
152 cleanup = typeof result === 'function' ? result : noop;
153 }
154 };
155 const unsubscribers = stores_array.map((store, i) =>
156 subscribe_to_store(
157 store,

Callers 1

derivedFunction · 0.85

Calls 3

cleanupFunction · 0.85
setFunction · 0.70
fnFunction · 0.50

Tested by

no test coverage detected