MCPcopy
hub / github.com/cpaczek/skylight / subscribe

Method subscribe

web/src/tracker/connection.ts:99–103  ·  view source on GitHub ↗
(fn: Listener)

Source from the content-addressed store, hash-verified

97 }
98
99 subscribe(fn: Listener): () => void {
100 this.listeners.add(fn);
101 fn(this.stream);
102 return () => this.listeners.delete(fn);
103 }
104
105 private update(partial: Partial<TrackerStreamState>): void {
106 this.stream = { ...this.stream, ...partial };

Callers 1

useTrackerFunction · 0.45

Calls 1

addMethod · 0.80

Tested by

no test coverage detected