Skip to content

Commit

Permalink
Add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-scheer committed Dec 9, 2021
1 parent ae86949 commit c30c19e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
File renamed without changes.
18 changes: 18 additions & 0 deletions gateway-js/src/utilities/waitUntil.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export function waitUntil<T = void>() {
let userResolved: (value: T | PromiseLike<T>) => void;
let userRejected: (reason?: any) => void;
const promise = new Promise<T>(
(r) => ((userResolved = r), (userRejected = r)),
);
return [
promise,
// @ts-ignore
userResolved,
// @ts-ignore
userRejected,
] as [
Promise<T>,
(value: T | PromiseLike<T>) => void,
(reason?: any) => void,
];
}

0 comments on commit c30c19e

Please sign in to comment.