fix(core): update
This commit is contained in:
parent
3b0052602f
commit
734d5aca35
@ -84,11 +84,11 @@ export const map = async <T>(inputArg: T[], functionArg: IAsyncFunction<T>) => {
|
||||
return resultArray;
|
||||
};
|
||||
|
||||
export const timeoutWrap = (ms, promise) => {
|
||||
export const timeoutWrap = <T = any>(promiseArg: Promise<T>, timeoutInMs: number) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
reject(new Error('timeout'));
|
||||
}, ms);
|
||||
promise.then(resolve, reject);
|
||||
}, timeoutInMs);
|
||||
promiseArg.then(resolve, reject);
|
||||
});
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user