MCPcopy Create free account
hub / github.com/angular/angular / addCallback

Method addCallback

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

Source from the content-addressed store, hash-verified

221 }
222
223 private addCallback(cb: Function, timeout?: number, updateCb?: Function) {
224 let timeoutId: any = -1;
225 if (timeout && timeout > 0) {
226 timeoutId = setTimeout(() => {
227 this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);
228 cb();
229 }, timeout);
230 }
231 this._callbacks.push(<WaitCallback>{doneCb: cb, timeoutId: timeoutId, updateCb: updateCb});
232 }
233
234 /**
235 * 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