diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-12-16 12:53:22 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-12-16 12:53:22 +0100 |
commit | fa4621e70c48500a372504eb8ae9b9481531c555 (patch) | |
tree | 50c457c8c2133dfec32cb465e1b3902ce88fb209 /src/util/query.ts | |
parent | 1b9c5855a8afb6833ff7a706f5bed5650e1191ad (diff) | |
download | wallet-core-fa4621e70c48500a372504eb8ae9b9481531c555.tar.xz |
history events WIP
Diffstat (limited to 'src/util/query.ts')
-rw-r--r-- | src/util/query.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util/query.ts b/src/util/query.ts index 08a8fec02..217c0674e 100644 --- a/src/util/query.ts +++ b/src/util/query.ts @@ -176,6 +176,17 @@ class ResultStream<T> { return arr; } + async forEachAsync(f: (x: T) => Promise<void>): Promise<void> { + while (true) { + const x = await this.next(); + if (x.hasValue) { + await f(x.value); + } else { + break; + } + } + } + async forEach(f: (x: T) => void): Promise<void> { while (true) { const x = await this.next(); |