MCPcopy Create free account
hub / github.com/angular/dev-infra / withResolverPromise

Function withResolverPromise

ng-dev/release/publish/test/common.spec.ts:695–708  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

693
694// Polyfill for `Promise.withResolvers`.
695function withResolverPromise<T>(): {
696 promise: Promise<T>;
697 resolve: (v: T) => void;
698 reject: (v: unknown) => void;
699} {
700 let resolve!: (v: T) => void;
701 let reject!: (v: unknown) => void;
702
703 const promise = new Promise<T>((res, rej) => {
704 resolve = res;
705 reject = rej;
706 });
707 return {promise, resolve, reject};
708}

Callers 1

common.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected