You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Replace usages of setImmediate with setTimeout for wider compatibility (#4240)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5a3d24abc2
commit
4cb851c51a
@@ -407,9 +407,12 @@ export async function logDuration<T>(logger: BaseLogger, name: string, block: ()
|
||||
|
||||
/**
|
||||
* Promise/async version of {@link setImmediate}.
|
||||
*
|
||||
* Implementation is based on `setTimeout` for wider compatibility.
|
||||
* @deprecated Use {@link sleep} instead.
|
||||
*/
|
||||
export function immediate(): Promise<void> {
|
||||
return new Promise(setImmediate);
|
||||
return new Promise((resolve) => setTimeout(resolve));
|
||||
}
|
||||
|
||||
export function isNullOrUndefined(val: any): boolean {
|
||||
|
||||
Reference in New Issue
Block a user