Function that runs in Promise.race() your promise and a timeout, if timeout completes first, resulting promise rejects with error.
export const resolveOrTimeout = <T = unknown>(
// Promise or a function that will be passed to a Promise object
promiseOrHandler:
| Promise<T>
| ((
resolve: (data: T) => void,