You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-22 09:02:11 +03:00
Typescript updates (#9658)
* Typescript updates * Update @types/node * Fix more types
This commit is contained in:
committed by
GitHub
parent
baaa9f5dd2
commit
d258402186
@@ -18,7 +18,7 @@ limitations under the License.
|
||||
// or when the timeout of ms is reached with the value of given timeoutValue
|
||||
export async function timeout<T, Y>(promise: Promise<T>, timeoutValue: Y, ms: number): Promise<T | Y> {
|
||||
const timeoutPromise = new Promise<T | Y>((resolve) => {
|
||||
const timeoutId = setTimeout(resolve, ms, timeoutValue);
|
||||
const timeoutId = window.setTimeout(resolve, ms, timeoutValue);
|
||||
promise.then(() => {
|
||||
clearTimeout(timeoutId);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user