MCPcopy Index your code
hub / github.com/atomicdata-dev/atomic-data-browser / unsubscribe

Method unsubscribe

lib/src/store.ts:362–371  ·  view source on GitHub ↗

Unregisters the callback (see `subscribe()`)

(subject: string, callback: callback)

Source from the content-addressed store, hash-verified

360
361 /** Unregisters the callback (see `subscribe()`) */
362 unsubscribe(subject: string, callback: callback): void {
363 if (subject == undefined) {
364 console.warn('Cannot unsubscribe from undefined subject');
365 return;
366 }
367 let callbackArray = this.subscribers.get(subject);
368 // Remove the function from the callBackArray
369 callbackArray = callbackArray?.filter(item => item !== callback);
370 this.subscribers.set(subject, callbackArray);
371 }
372}
373
374/**

Callers 2

useResourceFunction · 0.80
useResourcesFunction · 0.80

Calls 2

getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected