MCPcopy Create free account
hub / github.com/formkit/formkit / notifyReactiveStore

Function notifyReactiveStore

packages/react/src/reactiveStore.ts:44–57  ·  view source on GitHub ↗
(target: unknown)

Source from the content-addressed store, hash-verified

42}
43
44export function notifyReactiveStore(target: unknown): void {
45 const store = getReactiveStore(target)
46 if (!store) return
47 store.version++
48 if (store.pending) return
49 store.pending = true
50 queueMicrotask(() => {
51 store.pending = false
52 // Notify a stable snapshot so re-subscriptions during render don't
53 // recursively extend this notification pass.
54 const subscribers = Array.from(store.subscribers)
55 subscribers.forEach((subscriber) => subscriber())
56 })
57}
58
59export function clearReactiveStore(target: unknown): void {
60 const store = getReactiveStore(target)

Callers 3

getFunction · 0.90
notifyContextMutationFunction · 0.90
flushFunction · 0.90

Calls 1

getReactiveStoreFunction · 0.85

Tested by

no test coverage detected