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

Method wrapInTimeout

packages/core/src/event_emitter.ts:177–190  ·  view source on GitHub ↗
(fn: (value: unknown) => any)

Source from the content-addressed store, hash-verified

175 }
176
177 private wrapInTimeout(fn: (value: unknown) => any) {
178 return (value: unknown) => {
179 const taskId = this.pendingTasks?.add();
180 setTimeout(() => {
181 try {
182 fn(value);
183 } finally {
184 if (taskId !== undefined) {
185 this.pendingTasks?.remove(taskId);
186 }
187 }
188 });
189 };
190 }
191}
192
193/**

Callers 1

subscribeMethod · 0.95

Calls 4

setTimeoutFunction · 0.85
addMethod · 0.65
removeMethod · 0.65
fnFunction · 0.50

Tested by

no test coverage detected