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

Function promiseWithResolvers

packages/core/src/util/promise_with_resolvers.ts:37–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers.
36 */
37export function promiseWithResolvers<T>(): {
38 promise: Promise<T>;
39 resolve: (value: T | PromiseLike<T>) => void;
40 reject: (reason?: any) => void;
41} {
42 let resolve!: (value: T | PromiseLike<T>) => void;
43 let reject!: (reason?: any) => void;
44
45 const promise = new Promise<T>((res, rej) => {
46 resolve = res;
47 reject = rej;
48 });
49
50 return {promise, resolve, reject};
51}

Callers 6

rxResourceFunction · 0.90
resource_spec.tsFile · 0.90
onIdleFunction · 0.90
runLeaveAnimationsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…