aboutsummaryrefslogtreecommitdiff
path: root/src/util/timer.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-02 17:35:47 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-12-02 17:35:47 +0100
commitb5ee6b7b4ee506712f51e1b90e9256c4b0c0c603 (patch)
tree7d8bb4398ab52b58a5223d37e058eaea6c72f963 /src/util/timer.ts
parente1369ff7e8fc02116b9c4261036f0e42e3423cf4 (diff)
downloadwallet-core-b5ee6b7b4ee506712f51e1b90e9256c4b0c0c603.tar.xz
pending operations WIP
Diffstat (limited to 'src/util/timer.ts')
-rw-r--r--src/util/timer.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/timer.ts b/src/util/timer.ts
index d3bb5d485..865c17faf 100644
--- a/src/util/timer.ts
+++ b/src/util/timer.ts
@@ -105,6 +105,14 @@ export class TimerGroup {
}
}
+ resolveAfter(delayMs: number): Promise<void> {
+ return new Promise<void>((resolve, reject) => {
+ this.after(delayMs, () => {
+ resolve();
+ });
+ });
+ }
+
after(delayMs: number, callback: () => void): TimerHandle {
if (this.stopped) {
console.warn("dropping timer since timer group is stopped");