forked from MapComplete/MapComplete
Refactoring: move some loading logic into svelte element
This commit is contained in:
parent
8354da0fe1
commit
06c096b21a
5 changed files with 84 additions and 102 deletions
|
@ -1125,9 +1125,14 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
element.click()
|
||||
}
|
||||
|
||||
public static async waitFor(timeMillis: number): Promise<void> {
|
||||
public static async waitFor(timeMillis: number): Promise<void>;
|
||||
public static async waitFor<T>(timeMillis: number, t: T): Promise<T>;
|
||||
|
||||
public static async waitFor<T = void>(timeMillis: number, t: T): Promise<T> {
|
||||
return new Promise((resolve) => {
|
||||
window.setTimeout(resolve, timeMillis)
|
||||
window.setTimeout(() => {
|
||||
resolve(t)
|
||||
}, timeMillis)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue