@nlozgachev/pipelined 0.62.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{Duration-B8joKzro.d.cts → Duration-DeyxG6VQ.d.cts} +20 -20
- package/dist/{Duration-B8joKzro.d.ts → Duration-DeyxG6VQ.d.ts} +20 -20
- package/dist/{InternalTypes-LdhLQx3N.d.ts → InternalTypes-CCXa8Kvr.d.ts} +11 -11
- package/dist/{InternalTypes-DuK_XpTi.d.cts → InternalTypes-GFn4RTwD.d.cts} +11 -11
- package/dist/{Validation-DZLizBZ0.d.ts → Validation-C5RGZUXy.d.ts} +384 -280
- package/dist/{Validation-DC3uUizM.d.cts → Validation-KFUpea_k.d.cts} +384 -280
- package/dist/composition.cjs +216 -95
- package/dist/composition.d.cts +8 -76
- package/dist/composition.d.ts +8 -76
- package/dist/composition.mjs +216 -95
- package/dist/core.cjs +4784 -996
- package/dist/core.d.cts +269 -769
- package/dist/core.d.ts +269 -769
- package/dist/core.mjs +4784 -996
- package/dist/data.cjs +2916 -1240
- package/dist/data.d.cts +479 -1967
- package/dist/data.d.ts +479 -1967
- package/dist/data.mjs +2916 -1240
- package/dist/index.cjs +6739 -2169
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +6718 -2148
- package/dist/types.cjs +175 -31
- package/dist/types.d.cts +6 -6
- package/dist/types.d.ts +6 -6
- package/dist/types.mjs +175 -31
- package/package.json +24 -13
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ propagation, unhandled async rejections, race conditions, and verbose nested spr
|
|
|
22
22
|
`Task.Result` for lazy infallible async, `Op` for declarative request concurrency, and `Stream` for
|
|
23
23
|
typed event sequences.
|
|
24
24
|
|
|
25
|
-
The library has zero external dependencies, <
|
|
25
|
+
The library has zero external dependencies, <11 KB core gzipped (<17 KB total), and compiles to dual
|
|
26
26
|
ESM and CommonJS distributions.
|
|
27
27
|
|
|
28
28
|
## Documentation
|
|
@@ -550,13 +550,13 @@ if (Result.is.ok(email)) {
|
|
|
550
550
|
`pipelined` is structured into 4 isolated, tree-shakeable entry points:
|
|
551
551
|
|
|
552
552
|
- **`@nlozgachev/pipelined/core`**: Core context containers, async runtimes, optics, and logic
|
|
553
|
-
abstractions (<
|
|
553
|
+
abstractions (<11 KB gzipped).
|
|
554
554
|
- **`@nlozgachev/pipelined/data`**: Curried, data-last utilities for collections, numbers, strings,
|
|
555
|
-
and JSON (<
|
|
555
|
+
and JSON (<7 KB gzipped).
|
|
556
556
|
- **`@nlozgachev/pipelined/composition`**: Pure higher-order function combinators (`pipe`, `flow`,
|
|
557
557
|
`compose`, `curry`, `uncurry`, `converge`, `juxt`, `memoize`, `tap`, `on`, `not`, `flip`, `fn`)
|
|
558
|
-
(<
|
|
559
|
-
- **`@nlozgachev/pipelined/types`**: Type-level utilities (`Brand`, `Duration`, `RetryPolicy`) (<
|
|
558
|
+
(<2 KB gzipped).
|
|
559
|
+
- **`@nlozgachev/pipelined/types`**: Type-level utilities (`Brand`, `Duration`, `RetryPolicy`) (<400
|
|
560
560
|
B gzipped).
|
|
561
561
|
|
|
562
562
|
Every utility in the library is benchmarked against its native equivalent. While currying introduces
|
|
@@ -21,7 +21,7 @@ declare const _brand: unique symbol;
|
|
|
21
21
|
type Brand<K extends string, T> = T & {
|
|
22
22
|
readonly [_brand]: K;
|
|
23
23
|
};
|
|
24
|
-
declare
|
|
24
|
+
declare const Brand: {
|
|
25
25
|
/**
|
|
26
26
|
* Returns a constructor that wraps a value of type T in brand K.
|
|
27
27
|
* The resulting function performs an unchecked cast — only use when the raw
|
|
@@ -35,7 +35,7 @@ declare namespace Brand {
|
|
|
35
35
|
* const n: PositiveNumber = toPositiveNumber(42);
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
wrap: <K extends string, T>() => (value: T) => Brand<K, T>;
|
|
39
39
|
/**
|
|
40
40
|
* Strips the brand and returns the underlying value.
|
|
41
41
|
* Since Brand<K, T> extends T this is rarely needed, but can improve readability.
|
|
@@ -48,8 +48,8 @@ declare namespace Brand {
|
|
|
48
48
|
* const raw: string = Brand.unwrap(userId); // "user-123"
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
|
|
52
|
-
}
|
|
51
|
+
unwrap: <K extends string, T>(branded: Brand<K, T>) => T;
|
|
52
|
+
};
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* A branded nominal type representing a duration of time in milliseconds.
|
|
@@ -65,7 +65,7 @@ declare namespace Brand {
|
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
67
|
type Duration = Brand<"Duration", number>;
|
|
68
|
-
declare
|
|
68
|
+
declare const Duration: {
|
|
69
69
|
/**
|
|
70
70
|
* Creates a Duration from milliseconds.
|
|
71
71
|
*
|
|
@@ -74,7 +74,7 @@ declare namespace Duration {
|
|
|
74
74
|
* Duration.milliseconds(500); // 500ms Duration
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
|
-
|
|
77
|
+
milliseconds: (ms: number) => Duration;
|
|
78
78
|
/**
|
|
79
79
|
* Creates a Duration from seconds.
|
|
80
80
|
*
|
|
@@ -83,7 +83,7 @@ declare namespace Duration {
|
|
|
83
83
|
* Duration.seconds(2); // 2000ms Duration
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
seconds: (s: number) => Duration;
|
|
87
87
|
/**
|
|
88
88
|
* Creates a Duration from minutes.
|
|
89
89
|
*
|
|
@@ -92,7 +92,7 @@ declare namespace Duration {
|
|
|
92
92
|
* Duration.minutes(5); // 300000ms Duration
|
|
93
93
|
* ```
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
minutes: (m: number) => Duration;
|
|
96
96
|
/**
|
|
97
97
|
* Creates a Duration from hours.
|
|
98
98
|
*
|
|
@@ -101,7 +101,7 @@ declare namespace Duration {
|
|
|
101
101
|
* Duration.hours(1); // 3600000ms Duration
|
|
102
102
|
* ```
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
hours: (h: number) => Duration;
|
|
105
105
|
/**
|
|
106
106
|
* Creates a Duration from days.
|
|
107
107
|
*
|
|
@@ -110,8 +110,8 @@ declare namespace Duration {
|
|
|
110
110
|
* Duration.days(1); // 86400000ms Duration
|
|
111
111
|
* ```
|
|
112
112
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
days: (d: number) => Duration;
|
|
114
|
+
to: {
|
|
115
115
|
/**
|
|
116
116
|
* Converts a Duration back to raw milliseconds.
|
|
117
117
|
*
|
|
@@ -120,7 +120,7 @@ declare namespace Duration {
|
|
|
120
120
|
* Duration.to.milliseconds(Duration.seconds(2)); // 2000
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
|
-
|
|
123
|
+
milliseconds: (d: Duration) => number;
|
|
124
124
|
/**
|
|
125
125
|
* Converts a Duration to seconds.
|
|
126
126
|
*
|
|
@@ -129,7 +129,7 @@ declare namespace Duration {
|
|
|
129
129
|
* Duration.to.seconds(Duration.milliseconds(2500)); // 2.5
|
|
130
130
|
* ```
|
|
131
131
|
*/
|
|
132
|
-
|
|
132
|
+
seconds: (d: Duration) => number;
|
|
133
133
|
/**
|
|
134
134
|
* Converts a Duration to minutes.
|
|
135
135
|
*
|
|
@@ -138,7 +138,7 @@ declare namespace Duration {
|
|
|
138
138
|
* Duration.to.minutes(Duration.seconds(120)); // 2
|
|
139
139
|
* ```
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
minutes: (d: Duration) => number;
|
|
142
142
|
/**
|
|
143
143
|
* Converts a Duration to hours.
|
|
144
144
|
*
|
|
@@ -147,7 +147,7 @@ declare namespace Duration {
|
|
|
147
147
|
* Duration.to.hours(Duration.minutes(90)); // 1.5
|
|
148
148
|
* ```
|
|
149
149
|
*/
|
|
150
|
-
|
|
150
|
+
hours: (d: Duration) => number;
|
|
151
151
|
/**
|
|
152
152
|
* Converts a Duration to days.
|
|
153
153
|
*
|
|
@@ -156,8 +156,8 @@ declare namespace Duration {
|
|
|
156
156
|
* Duration.to.days(Duration.hours(36)); // 1.5
|
|
157
157
|
* ```
|
|
158
158
|
*/
|
|
159
|
-
|
|
160
|
-
}
|
|
159
|
+
days: (d: Duration) => number;
|
|
160
|
+
};
|
|
161
161
|
/**
|
|
162
162
|
* Adds two Durations together.
|
|
163
163
|
*
|
|
@@ -166,7 +166,7 @@ declare namespace Duration {
|
|
|
166
166
|
* pipe(Duration.seconds(1), Duration.add(Duration.milliseconds(500))); // 1500ms
|
|
167
167
|
* ```
|
|
168
168
|
*/
|
|
169
|
-
|
|
169
|
+
add: (other: Duration) => (self: Duration) => Duration;
|
|
170
170
|
/**
|
|
171
171
|
* Subtracts the other Duration from this one.
|
|
172
172
|
*
|
|
@@ -175,7 +175,7 @@ declare namespace Duration {
|
|
|
175
175
|
* pipe(Duration.seconds(1), Duration.subtract(Duration.milliseconds(500))); // 500ms
|
|
176
176
|
* ```
|
|
177
177
|
*/
|
|
178
|
-
|
|
179
|
-
}
|
|
178
|
+
subtract: (other: Duration) => (self: Duration) => Duration;
|
|
179
|
+
};
|
|
180
180
|
|
|
181
181
|
export { Brand as B, Duration as D };
|
|
@@ -21,7 +21,7 @@ declare const _brand: unique symbol;
|
|
|
21
21
|
type Brand<K extends string, T> = T & {
|
|
22
22
|
readonly [_brand]: K;
|
|
23
23
|
};
|
|
24
|
-
declare
|
|
24
|
+
declare const Brand: {
|
|
25
25
|
/**
|
|
26
26
|
* Returns a constructor that wraps a value of type T in brand K.
|
|
27
27
|
* The resulting function performs an unchecked cast — only use when the raw
|
|
@@ -35,7 +35,7 @@ declare namespace Brand {
|
|
|
35
35
|
* const n: PositiveNumber = toPositiveNumber(42);
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
wrap: <K extends string, T>() => (value: T) => Brand<K, T>;
|
|
39
39
|
/**
|
|
40
40
|
* Strips the brand and returns the underlying value.
|
|
41
41
|
* Since Brand<K, T> extends T this is rarely needed, but can improve readability.
|
|
@@ -48,8 +48,8 @@ declare namespace Brand {
|
|
|
48
48
|
* const raw: string = Brand.unwrap(userId); // "user-123"
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
|
|
52
|
-
}
|
|
51
|
+
unwrap: <K extends string, T>(branded: Brand<K, T>) => T;
|
|
52
|
+
};
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* A branded nominal type representing a duration of time in milliseconds.
|
|
@@ -65,7 +65,7 @@ declare namespace Brand {
|
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
67
|
type Duration = Brand<"Duration", number>;
|
|
68
|
-
declare
|
|
68
|
+
declare const Duration: {
|
|
69
69
|
/**
|
|
70
70
|
* Creates a Duration from milliseconds.
|
|
71
71
|
*
|
|
@@ -74,7 +74,7 @@ declare namespace Duration {
|
|
|
74
74
|
* Duration.milliseconds(500); // 500ms Duration
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
|
-
|
|
77
|
+
milliseconds: (ms: number) => Duration;
|
|
78
78
|
/**
|
|
79
79
|
* Creates a Duration from seconds.
|
|
80
80
|
*
|
|
@@ -83,7 +83,7 @@ declare namespace Duration {
|
|
|
83
83
|
* Duration.seconds(2); // 2000ms Duration
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
seconds: (s: number) => Duration;
|
|
87
87
|
/**
|
|
88
88
|
* Creates a Duration from minutes.
|
|
89
89
|
*
|
|
@@ -92,7 +92,7 @@ declare namespace Duration {
|
|
|
92
92
|
* Duration.minutes(5); // 300000ms Duration
|
|
93
93
|
* ```
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
minutes: (m: number) => Duration;
|
|
96
96
|
/**
|
|
97
97
|
* Creates a Duration from hours.
|
|
98
98
|
*
|
|
@@ -101,7 +101,7 @@ declare namespace Duration {
|
|
|
101
101
|
* Duration.hours(1); // 3600000ms Duration
|
|
102
102
|
* ```
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
hours: (h: number) => Duration;
|
|
105
105
|
/**
|
|
106
106
|
* Creates a Duration from days.
|
|
107
107
|
*
|
|
@@ -110,8 +110,8 @@ declare namespace Duration {
|
|
|
110
110
|
* Duration.days(1); // 86400000ms Duration
|
|
111
111
|
* ```
|
|
112
112
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
days: (d: number) => Duration;
|
|
114
|
+
to: {
|
|
115
115
|
/**
|
|
116
116
|
* Converts a Duration back to raw milliseconds.
|
|
117
117
|
*
|
|
@@ -120,7 +120,7 @@ declare namespace Duration {
|
|
|
120
120
|
* Duration.to.milliseconds(Duration.seconds(2)); // 2000
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
|
-
|
|
123
|
+
milliseconds: (d: Duration) => number;
|
|
124
124
|
/**
|
|
125
125
|
* Converts a Duration to seconds.
|
|
126
126
|
*
|
|
@@ -129,7 +129,7 @@ declare namespace Duration {
|
|
|
129
129
|
* Duration.to.seconds(Duration.milliseconds(2500)); // 2.5
|
|
130
130
|
* ```
|
|
131
131
|
*/
|
|
132
|
-
|
|
132
|
+
seconds: (d: Duration) => number;
|
|
133
133
|
/**
|
|
134
134
|
* Converts a Duration to minutes.
|
|
135
135
|
*
|
|
@@ -138,7 +138,7 @@ declare namespace Duration {
|
|
|
138
138
|
* Duration.to.minutes(Duration.seconds(120)); // 2
|
|
139
139
|
* ```
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
minutes: (d: Duration) => number;
|
|
142
142
|
/**
|
|
143
143
|
* Converts a Duration to hours.
|
|
144
144
|
*
|
|
@@ -147,7 +147,7 @@ declare namespace Duration {
|
|
|
147
147
|
* Duration.to.hours(Duration.minutes(90)); // 1.5
|
|
148
148
|
* ```
|
|
149
149
|
*/
|
|
150
|
-
|
|
150
|
+
hours: (d: Duration) => number;
|
|
151
151
|
/**
|
|
152
152
|
* Converts a Duration to days.
|
|
153
153
|
*
|
|
@@ -156,8 +156,8 @@ declare namespace Duration {
|
|
|
156
156
|
* Duration.to.days(Duration.hours(36)); // 1.5
|
|
157
157
|
* ```
|
|
158
158
|
*/
|
|
159
|
-
|
|
160
|
-
}
|
|
159
|
+
days: (d: Duration) => number;
|
|
160
|
+
};
|
|
161
161
|
/**
|
|
162
162
|
* Adds two Durations together.
|
|
163
163
|
*
|
|
@@ -166,7 +166,7 @@ declare namespace Duration {
|
|
|
166
166
|
* pipe(Duration.seconds(1), Duration.add(Duration.milliseconds(500))); // 1500ms
|
|
167
167
|
* ```
|
|
168
168
|
*/
|
|
169
|
-
|
|
169
|
+
add: (other: Duration) => (self: Duration) => Duration;
|
|
170
170
|
/**
|
|
171
171
|
* Subtracts the other Duration from this one.
|
|
172
172
|
*
|
|
@@ -175,7 +175,7 @@ declare namespace Duration {
|
|
|
175
175
|
* pipe(Duration.seconds(1), Duration.subtract(Duration.milliseconds(500))); // 500ms
|
|
176
176
|
* ```
|
|
177
177
|
*/
|
|
178
|
-
|
|
179
|
-
}
|
|
178
|
+
subtract: (other: Duration) => (self: Duration) => Duration;
|
|
179
|
+
};
|
|
180
180
|
|
|
181
181
|
export { Brand as B, Duration as D };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Duration } from './Duration-
|
|
1
|
+
import { D as Duration } from './Duration-DeyxG6VQ.js';
|
|
2
2
|
|
|
3
3
|
declare const _deferred: unique symbol;
|
|
4
4
|
/**
|
|
@@ -24,8 +24,8 @@ type Deferred<A> = {
|
|
|
24
24
|
readonly [_deferred]: A;
|
|
25
25
|
readonly then: (onfulfilled: (value: A) => unknown) => void;
|
|
26
26
|
};
|
|
27
|
-
declare
|
|
28
|
-
|
|
27
|
+
declare const Deferred: {
|
|
28
|
+
from: {
|
|
29
29
|
/**
|
|
30
30
|
* Wraps a `Promise` or `Deferred` into a `Deferred`, structurally excluding rejection handlers,
|
|
31
31
|
* `.catch()`, `.finally()`, and chainable `.then()`.
|
|
@@ -40,9 +40,9 @@ declare namespace Deferred {
|
|
|
40
40
|
* const value = await d; // "hello"
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
43
|
+
Promise: <A>(p: Thenable<A>) => Deferred<A>;
|
|
44
|
+
};
|
|
45
|
+
to: {
|
|
46
46
|
/**
|
|
47
47
|
* Converts a `Deferred` back into a `Promise`.
|
|
48
48
|
*
|
|
@@ -52,8 +52,8 @@ declare namespace Deferred {
|
|
|
52
52
|
* // p is Promise<42>
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
|
|
56
|
-
}
|
|
55
|
+
Promise: <A>(d: Deferred<A>) => globalThis.Promise<A>;
|
|
56
|
+
};
|
|
57
57
|
/**
|
|
58
58
|
* Combines an array or tuple of `Deferred` values into a single `Deferred` of a tuple.
|
|
59
59
|
* Resolves when all input `Deferred`s resolve.
|
|
@@ -63,7 +63,7 @@ declare namespace Deferred {
|
|
|
63
63
|
* const [a, b] = await Deferred.all([d1, d2]);
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
all: <T extends readonly Deferred<unknown>[]>(deferreds: T) => Deferred<{ [K in keyof T]: T[K] extends Deferred<infer A> ? A : never; }>;
|
|
67
67
|
/**
|
|
68
68
|
* Races multiple `Deferred` values and resolves with the first one to settle.
|
|
69
69
|
*
|
|
@@ -72,8 +72,8 @@ declare namespace Deferred {
|
|
|
72
72
|
* const winner = await Deferred.race([d1, d2]);
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
|
|
76
|
-
}
|
|
75
|
+
race: <A>(deferreds: ReadonlyArray<Deferred<A>>) => Deferred<A>;
|
|
76
|
+
};
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Represents a promise-like object or a deferred value that can be resolved with `.then()`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Duration } from './Duration-
|
|
1
|
+
import { D as Duration } from './Duration-DeyxG6VQ.cjs';
|
|
2
2
|
|
|
3
3
|
declare const _deferred: unique symbol;
|
|
4
4
|
/**
|
|
@@ -24,8 +24,8 @@ type Deferred<A> = {
|
|
|
24
24
|
readonly [_deferred]: A;
|
|
25
25
|
readonly then: (onfulfilled: (value: A) => unknown) => void;
|
|
26
26
|
};
|
|
27
|
-
declare
|
|
28
|
-
|
|
27
|
+
declare const Deferred: {
|
|
28
|
+
from: {
|
|
29
29
|
/**
|
|
30
30
|
* Wraps a `Promise` or `Deferred` into a `Deferred`, structurally excluding rejection handlers,
|
|
31
31
|
* `.catch()`, `.finally()`, and chainable `.then()`.
|
|
@@ -40,9 +40,9 @@ declare namespace Deferred {
|
|
|
40
40
|
* const value = await d; // "hello"
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
43
|
+
Promise: <A>(p: Thenable<A>) => Deferred<A>;
|
|
44
|
+
};
|
|
45
|
+
to: {
|
|
46
46
|
/**
|
|
47
47
|
* Converts a `Deferred` back into a `Promise`.
|
|
48
48
|
*
|
|
@@ -52,8 +52,8 @@ declare namespace Deferred {
|
|
|
52
52
|
* // p is Promise<42>
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
|
|
56
|
-
}
|
|
55
|
+
Promise: <A>(d: Deferred<A>) => globalThis.Promise<A>;
|
|
56
|
+
};
|
|
57
57
|
/**
|
|
58
58
|
* Combines an array or tuple of `Deferred` values into a single `Deferred` of a tuple.
|
|
59
59
|
* Resolves when all input `Deferred`s resolve.
|
|
@@ -63,7 +63,7 @@ declare namespace Deferred {
|
|
|
63
63
|
* const [a, b] = await Deferred.all([d1, d2]);
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
all: <T extends readonly Deferred<unknown>[]>(deferreds: T) => Deferred<{ [K in keyof T]: T[K] extends Deferred<infer A> ? A : never; }>;
|
|
67
67
|
/**
|
|
68
68
|
* Races multiple `Deferred` values and resolves with the first one to settle.
|
|
69
69
|
*
|
|
@@ -72,8 +72,8 @@ declare namespace Deferred {
|
|
|
72
72
|
* const winner = await Deferred.race([d1, d2]);
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
|
|
76
|
-
}
|
|
75
|
+
race: <A>(deferreds: ReadonlyArray<Deferred<A>>) => Deferred<A>;
|
|
76
|
+
};
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Represents a promise-like object or a deferred value that can be resolved with `.then()`.
|