We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab04940 commit 2b48d67Copy full SHA for 2b48d67
test/run.ts
@@ -3,11 +3,14 @@
3
import { testCase } from "./experiment.spec";
4
import reducePathTC from "../reducePath.spec";
5
6
+import { sequentialResolve } from "../util/sequentialResolve";
7
+
8
main();
9
function main() {
- Promise.all([
- testCase(), //
10
- reducePathTC(),
+ // TODO Promise.all
11
+ sequentialResolve([
12
+ testCase, //
13
+ async () => reducePathTC(),
14
])
15
.then(() => process.stdout.write("\nsuccess\n\n"))
16
.catch((e) => {
util/sequentialResolve.ts
@@ -0,0 +1,5 @@
1
+export const sequentialResolve = <T>(xs: (() => Promise<T>)[]): Promise<T> =>
2
+ xs.reduce(
+ (prev, curr) => prev.then(curr), //
+ (Promise.resolve() as unknown) as Promise<T>
+ );
0 commit comments