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

Function promiseWithResolvers

packages/forms/signals/test/web/interop.spec.ts:1530–1544  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1528 */
1529// TODO: share this with submit.spec.ts
1530function promiseWithResolvers<T = void>(): {
1531 promise: Promise<T>;
1532 resolve: (value: T | PromiseLike<T>) => void;
1533 reject: (reason?: any) => void;
1534} {
1535 let resolve!: (value: T | PromiseLike<T>) => void;
1536 let reject!: (reason?: any) => void;
1537
1538 const promise = new Promise<T>((res, rej) => {
1539 resolve = res;
1540 reject = rej;
1541 });
1542
1543 return {promise, resolve, reject};
1544}

Callers 2

interop.spec.tsFile · 0.70
handleNavigateMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected