fix: remove monorepo
This commit is contained in:
19
app/utils/promises.ts
Normal file
19
app/utils/promises.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export function withResolvers<T>(): PromiseWithResolvers<T> {
|
||||
if (typeof Promise.withResolvers === 'function') {
|
||||
return Promise.withResolvers();
|
||||
}
|
||||
|
||||
let resolve!: (value: T | PromiseLike<T>) => void;
|
||||
let reject!: (reason?: any) => void;
|
||||
|
||||
const promise = new Promise<T>((_resolve, _reject) => {
|
||||
resolve = _resolve;
|
||||
reject = _reject;
|
||||
});
|
||||
|
||||
return {
|
||||
resolve,
|
||||
reject,
|
||||
promise,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user