MCPcopy Index your code
hub / github.com/OneNoteDev/WebClipper / notifySubscribers

Method notifySubscribers

src/scripts/communicator/smartValue.ts:67–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65 }
66
67 private notifySubscribers() {
68 let numSubscribers = this.subscriptions.length;
69 for (let i = 0; i < numSubscribers; i++) {
70 this.subscriptions[i].times--;
71 this.subscriptions[i].func(this.t);
72
73 let noMoreExecutions = this.subscriptions[i] && this.subscriptions[i].times === 0;
74 if (noMoreExecutions) {
75 this.subscriptions.splice(i, 1);
76 }
77
78 // We check for undefined as the callback could have called unsubscribe
79 if (!this.subscriptions[i] || noMoreExecutions) {
80 numSubscribers--;
81 i--;
82 }
83 }
84 }
85
86 // Subscribe to multiple SVs.
87 // Example:

Callers 2

setMethod · 0.95
forceUpdateMethod · 0.95

Calls 1

funcMethod · 0.80

Tested by

no test coverage detected