MCPcopy
hub / github.com/bbycroft/llm-viz / Subscriptions

Class Subscriptions

src/utils/hooks.ts:89–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88
89export class Subscriptions {
90 subs = new Set<() => void>();
91 subscribe = (fn: () => void): (() => void) => {
92 this.subs.add(fn);
93 return () => this.subs.delete(fn);
94 }
95 notify = () => {
96 for (let sub of this.subs) {
97 sub();
98 }
99 }
100}
101
102export function useSubscriptions(subscription: Subscriptions | null) {
103 let [, refresh] = useReducer(a => a + 1, 0);

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected