MCPcopy Create free account
hub / github.com/arethetypeswrong/arethetypeswrong.github.io / subscribe

Function subscribe

packages/web/src/state.ts:41–46  ·  view source on GitHub ↗
(callback: (prevState: DeepReadonly<State>) => void)

Source from the content-addressed store, hash-verified

39const subscribers: Set<(state: DeepReadonly<State>) => void> = new Set();
40
41export function subscribe(callback: (prevState: DeepReadonly<State>) => void): () => void {
42 subscribers.add(callback);
43 return () => {
44 subscribers.delete(callback);
45 };
46}
47
48export function updateState(updater: (draftState: State) => void): void {
49 const prevState = state;

Callers 2

subscribeRendererFunction · 0.90
main.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected