MCPcopy Index your code
hub / github.com/angular/angular / addCallback

Method addCallback

packages/core/src/testability/testability.ts:221–230  ·  view source on GitHub ↗
(cb: Function, timeout?: number, updateCb?: Function)

Source from the content-addressed store, hash-verified

219 }
220
221 private addCallback(cb: Function, timeout?: number, updateCb?: Function) {
222 let timeoutId: any = -1;
223 if (timeout && timeout > 0) {
224 timeoutId = setTimeout(() => {
225 this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);
226 cb();
227 }, timeout);
228 }
229 this._callbacks.push(<WaitCallback>{doneCb: cb, timeoutId: timeoutId, updateCb: updateCb});
230 }
231
232 /**
233 * Wait for the application to be stable with a timeout. If the timeout is reached before that

Callers 1

whenStableMethod · 0.95

Calls 4

setTimeoutFunction · 0.85
cbFunction · 0.50
filterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected