@typed/fx 2.0.0-beta.6 → 2.0.0-beta.7
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/dist/Fx/Fx.d.ts +9 -9
- package/dist/Fx/Fx.js +1 -1
- package/dist/Fx/TypeId.d.ts +3 -3
- package/dist/Fx/TypeId.js +2 -2
- package/dist/Fx/combinators/additive.d.ts +6 -6
- package/dist/Fx/combinators/additive.js +6 -6
- package/dist/Fx/combinators/catch.d.ts +7 -7
- package/dist/Fx/combinators/catch.js +7 -7
- package/dist/Fx/combinators/causes.d.ts +1 -1
- package/dist/Fx/combinators/causes.js +1 -1
- package/dist/Fx/combinators/changesWithEffect.d.ts +1 -1
- package/dist/Fx/combinators/changesWithEffect.js +1 -1
- package/dist/Fx/combinators/compact.d.ts +1 -1
- package/dist/Fx/combinators/compact.js +1 -1
- package/dist/Fx/combinators/concatMap.d.ts +2 -2
- package/dist/Fx/combinators/concatMap.js +2 -2
- package/dist/Fx/combinators/continueWith.d.ts +4 -4
- package/dist/Fx/combinators/continueWith.js +4 -4
- package/dist/Fx/combinators/debounce.d.ts +2 -2
- package/dist/Fx/combinators/debounce.d.ts.map +1 -1
- package/dist/Fx/combinators/debounce.js +1 -1
- package/dist/Fx/combinators/delay.d.ts +9 -7
- package/dist/Fx/combinators/delay.d.ts.map +1 -1
- package/dist/Fx/combinators/delay.js +8 -6
- package/dist/Fx/combinators/dropUntil.d.ts +2 -2
- package/dist/Fx/combinators/dropUntil.js +2 -2
- package/dist/Fx/combinators/during.d.ts +1 -1
- package/dist/Fx/combinators/during.js +1 -1
- package/dist/Fx/combinators/ensuring.d.ts +1 -1
- package/dist/Fx/combinators/ensuring.js +1 -1
- package/dist/Fx/combinators/exhaustLatestMap.d.ts +1 -1
- package/dist/Fx/combinators/exhaustLatestMap.js +1 -1
- package/dist/Fx/combinators/exhaustLatestMapEffect.d.ts +1 -1
- package/dist/Fx/combinators/exhaustLatestMapEffect.js +1 -1
- package/dist/Fx/combinators/exhaustMap.d.ts +1 -1
- package/dist/Fx/combinators/exhaustMap.js +1 -1
- package/dist/Fx/combinators/exhaustMapEffect.d.ts +1 -1
- package/dist/Fx/combinators/exhaustMapEffect.js +1 -1
- package/dist/Fx/combinators/exit.d.ts +1 -1
- package/dist/Fx/combinators/exit.js +1 -1
- package/dist/Fx/combinators/filter.d.ts +1 -1
- package/dist/Fx/combinators/filter.js +1 -1
- package/dist/Fx/combinators/filterEffect.d.ts +1 -1
- package/dist/Fx/combinators/filterEffect.js +1 -1
- package/dist/Fx/combinators/filterMap.d.ts +1 -1
- package/dist/Fx/combinators/filterMap.js +1 -1
- package/dist/Fx/combinators/filterMapEffect.d.ts +1 -1
- package/dist/Fx/combinators/filterMapEffect.js +1 -1
- package/dist/Fx/combinators/filterMapLoop.d.ts +1 -1
- package/dist/Fx/combinators/filterMapLoop.js +1 -1
- package/dist/Fx/combinators/filterMapLoopCause.d.ts +1 -1
- package/dist/Fx/combinators/filterMapLoopCause.js +1 -1
- package/dist/Fx/combinators/filterMapLoopCauseEffect.d.ts +1 -1
- package/dist/Fx/combinators/filterMapLoopCauseEffect.js +1 -1
- package/dist/Fx/combinators/filterMapLoopEffect.d.ts +1 -1
- package/dist/Fx/combinators/filterMapLoopEffect.js +1 -1
- package/dist/Fx/combinators/flatMap.d.ts +2 -2
- package/dist/Fx/combinators/flatMap.js +1 -1
- package/dist/Fx/combinators/flatMapConcurrently.d.ts +1 -1
- package/dist/Fx/combinators/flatMapConcurrently.js +1 -1
- package/dist/Fx/combinators/flatMapConcurrentlyEffect.d.ts +1 -1
- package/dist/Fx/combinators/flatMapConcurrentlyEffect.js +1 -1
- package/dist/Fx/combinators/flatMapEffect.d.ts +2 -2
- package/dist/Fx/combinators/flatMapEffect.js +1 -1
- package/dist/Fx/combinators/flip.d.ts +1 -1
- package/dist/Fx/combinators/flip.js +1 -1
- package/dist/Fx/combinators/gen.d.ts +1 -1
- package/dist/Fx/combinators/gen.js +1 -1
- package/dist/Fx/combinators/genScoped.d.ts +1 -1
- package/dist/Fx/combinators/genScoped.js +1 -1
- package/dist/Fx/combinators/grouped.d.ts +2 -2
- package/dist/Fx/combinators/grouped.js +2 -2
- package/dist/Fx/combinators/keyed.d.ts +2 -2
- package/dist/Fx/combinators/keyed.js +1 -1
- package/dist/Fx/combinators/loop.d.ts +1 -1
- package/dist/Fx/combinators/loop.js +1 -1
- package/dist/Fx/combinators/loopCause.d.ts +1 -1
- package/dist/Fx/combinators/loopCause.js +1 -1
- package/dist/Fx/combinators/loopCauseEffect.d.ts +1 -1
- package/dist/Fx/combinators/loopCauseEffect.js +1 -1
- package/dist/Fx/combinators/loopEffect.d.ts +1 -1
- package/dist/Fx/combinators/loopEffect.js +1 -1
- package/dist/Fx/combinators/map.d.ts +2 -2
- package/dist/Fx/combinators/map.js +2 -2
- package/dist/Fx/combinators/mapBoth.d.ts +1 -1
- package/dist/Fx/combinators/mapBoth.js +1 -1
- package/dist/Fx/combinators/mapEffect.d.ts +1 -1
- package/dist/Fx/combinators/mapEffect.js +1 -1
- package/dist/Fx/combinators/mapError.d.ts +1 -1
- package/dist/Fx/combinators/mapError.js +1 -1
- package/dist/Fx/combinators/mergeAll.d.ts +1 -1
- package/dist/Fx/combinators/mergeAll.js +1 -1
- package/dist/Fx/combinators/mergeOrdered.d.ts +1 -1
- package/dist/Fx/combinators/mergeOrdered.d.ts.map +1 -1
- package/dist/Fx/combinators/mergeOrdered.js +33 -11
- package/dist/Fx/combinators/onError.d.ts +1 -1
- package/dist/Fx/combinators/onError.js +1 -1
- package/dist/Fx/combinators/onExit.d.ts +1 -1
- package/dist/Fx/combinators/onExit.js +1 -1
- package/dist/Fx/combinators/onInterrupt.d.ts +1 -1
- package/dist/Fx/combinators/onInterrupt.js +1 -1
- package/dist/Fx/combinators/pairwise.d.ts +1 -1
- package/dist/Fx/combinators/pairwise.js +1 -1
- package/dist/Fx/combinators/provide.d.ts +4 -4
- package/dist/Fx/combinators/provide.js +4 -4
- package/dist/Fx/combinators/race.d.ts +2 -2
- package/dist/Fx/combinators/race.js +2 -2
- package/dist/Fx/combinators/repeat.d.ts +1 -1
- package/dist/Fx/combinators/repeat.js +1 -1
- package/dist/Fx/combinators/result.d.ts +1 -1
- package/dist/Fx/combinators/result.js +1 -1
- package/dist/Fx/combinators/retry.d.ts +1 -1
- package/dist/Fx/combinators/retry.js +1 -1
- package/dist/Fx/combinators/sample.d.ts +1 -1
- package/dist/Fx/combinators/sample.js +1 -1
- package/dist/Fx/combinators/scan.d.ts +2 -2
- package/dist/Fx/combinators/scan.js +2 -2
- package/dist/Fx/combinators/since.d.ts +1 -1
- package/dist/Fx/combinators/since.js +1 -1
- package/dist/Fx/combinators/skip.d.ts +2 -2
- package/dist/Fx/combinators/skip.js +2 -2
- package/dist/Fx/combinators/skipRepeats.d.ts +1 -1
- package/dist/Fx/combinators/skipRepeats.js +1 -1
- package/dist/Fx/combinators/skipRepeatsWith.d.ts +1 -1
- package/dist/Fx/combinators/skipRepeatsWith.js +1 -1
- package/dist/Fx/combinators/skipWhile.d.ts +4 -4
- package/dist/Fx/combinators/skipWhile.js +4 -4
- package/dist/Fx/combinators/slice.d.ts +3 -3
- package/dist/Fx/combinators/slice.js +2 -2
- package/dist/Fx/combinators/switchMap.d.ts +1 -1
- package/dist/Fx/combinators/switchMap.js +1 -1
- package/dist/Fx/combinators/switchMapEffect.d.ts +1 -1
- package/dist/Fx/combinators/switchMapEffect.js +1 -1
- package/dist/Fx/combinators/take.d.ts +2 -2
- package/dist/Fx/combinators/take.js +2 -2
- package/dist/Fx/combinators/takeUntil.d.ts +3 -3
- package/dist/Fx/combinators/takeUntil.js +3 -3
- package/dist/Fx/combinators/takeWhile.d.ts +2 -2
- package/dist/Fx/combinators/takeWhile.js +2 -2
- package/dist/Fx/combinators/tapEffect.d.ts +1 -1
- package/dist/Fx/combinators/tapEffect.js +1 -1
- package/dist/Fx/combinators/throttle.d.ts +3 -3
- package/dist/Fx/combinators/throttle.d.ts.map +1 -1
- package/dist/Fx/combinators/throttle.js +1 -1
- package/dist/Fx/combinators/timeout.d.ts +2 -2
- package/dist/Fx/combinators/timeout.js +2 -2
- package/dist/Fx/combinators/tuple.d.ts +2 -2
- package/dist/Fx/combinators/tuple.js +2 -2
- package/dist/Fx/combinators/until.d.ts +1 -1
- package/dist/Fx/combinators/until.js +1 -1
- package/dist/Fx/combinators/unwrap.d.ts +1 -1
- package/dist/Fx/combinators/unwrap.js +1 -1
- package/dist/Fx/combinators/unwrapScoped.d.ts +1 -1
- package/dist/Fx/combinators/unwrapScoped.js +1 -1
- package/dist/Fx/combinators/when.d.ts +2 -2
- package/dist/Fx/combinators/when.js +2 -2
- package/dist/Fx/combinators/withLatestFrom.d.ts +2 -2
- package/dist/Fx/combinators/withLatestFrom.js +2 -2
- package/dist/Fx/combinators/withSpan.d.ts +1 -1
- package/dist/Fx/combinators/withSpan.js +1 -1
- package/dist/Fx/combinators/zip.d.ts +4 -4
- package/dist/Fx/combinators/zip.js +4 -4
- package/dist/Fx/constructors/at.d.ts +1 -1
- package/dist/Fx/constructors/at.js +1 -1
- package/dist/Fx/constructors/die.d.ts +1 -1
- package/dist/Fx/constructors/die.js +1 -1
- package/dist/Fx/constructors/empty.d.ts +1 -1
- package/dist/Fx/constructors/empty.js +1 -1
- package/dist/Fx/constructors/fail.d.ts +1 -1
- package/dist/Fx/constructors/fail.js +1 -1
- package/dist/Fx/constructors/failCause.d.ts +1 -1
- package/dist/Fx/constructors/failCause.js +1 -1
- package/dist/Fx/constructors/fn.d.ts +4 -4
- package/dist/Fx/constructors/fn.js +1 -1
- package/dist/Fx/constructors/fromEffect.d.ts +2 -2
- package/dist/Fx/constructors/fromEffect.js +2 -2
- package/dist/Fx/constructors/fromFailures.d.ts +1 -1
- package/dist/Fx/constructors/fromFailures.js +1 -1
- package/dist/Fx/constructors/fromIterable.d.ts +1 -1
- package/dist/Fx/constructors/fromIterable.js +1 -1
- package/dist/Fx/constructors/fromSchedule.d.ts +6 -4
- package/dist/Fx/constructors/fromSchedule.d.ts.map +1 -1
- package/dist/Fx/constructors/fromSchedule.js +6 -4
- package/dist/Fx/constructors/interrupt.d.ts +1 -1
- package/dist/Fx/constructors/interrupt.js +1 -1
- package/dist/Fx/constructors/make.d.ts +9 -7
- package/dist/Fx/constructors/make.d.ts.map +1 -1
- package/dist/Fx/constructors/make.js +8 -6
- package/dist/Fx/constructors/periodic.d.ts +1 -1
- package/dist/Fx/constructors/periodic.js +1 -1
- package/dist/Fx/constructors/succeed.d.ts +4 -4
- package/dist/Fx/constructors/succeed.js +4 -4
- package/dist/Fx/constructors/suspend.d.ts +1 -1
- package/dist/Fx/constructors/suspend.js +1 -1
- package/dist/Fx/constructors/sync.d.ts +1 -1
- package/dist/Fx/constructors/sync.js +1 -1
- package/dist/Fx/run/collect.d.ts +4 -4
- package/dist/Fx/run/collect.js +4 -4
- package/dist/Fx/run/first.d.ts +1 -1
- package/dist/Fx/run/first.js +1 -1
- package/dist/Fx/run/fork.d.ts +2 -2
- package/dist/Fx/run/fork.js +2 -2
- package/dist/Fx/run/observe.d.ts +7 -5
- package/dist/Fx/run/observe.d.ts.map +1 -1
- package/dist/Fx/run/observe.js +30 -15
- package/dist/Fx/run/runPromise.d.ts +2 -2
- package/dist/Fx/run/runPromise.js +2 -2
- package/dist/Fx/stream.d.ts +4 -4
- package/dist/Fx/stream.js +2 -2
- package/dist/Push/Push.d.ts +30 -30
- package/dist/Push/Push.js +26 -26
- package/dist/RefSubject/Hydration.d.ts +24 -24
- package/dist/RefSubject/Hydration.js +5 -5
- package/dist/RefSubject/RefArray.d.ts +31 -31
- package/dist/RefSubject/RefArray.js +30 -30
- package/dist/RefSubject/RefBigDecimal.d.ts +20 -20
- package/dist/RefSubject/RefBigDecimal.js +19 -19
- package/dist/RefSubject/RefBigInt.d.ts +15 -15
- package/dist/RefSubject/RefBigInt.js +14 -14
- package/dist/RefSubject/RefBoolean.d.ts +15 -15
- package/dist/RefSubject/RefBoolean.js +14 -14
- package/dist/RefSubject/RefCause.d.ts +11 -11
- package/dist/RefSubject/RefCause.js +10 -10
- package/dist/RefSubject/RefChunk.d.ts +37 -37
- package/dist/RefSubject/RefChunk.js +36 -36
- package/dist/RefSubject/RefDateTime.d.ts +11 -11
- package/dist/RefSubject/RefDateTime.js +10 -10
- package/dist/RefSubject/RefDuration.d.ts +14 -14
- package/dist/RefSubject/RefDuration.js +13 -13
- package/dist/RefSubject/RefGraph.d.ts +29 -29
- package/dist/RefSubject/RefGraph.js +28 -28
- package/dist/RefSubject/RefHashMap.d.ts +27 -27
- package/dist/RefSubject/RefHashMap.js +26 -26
- package/dist/RefSubject/RefHashRing.d.ts +13 -13
- package/dist/RefSubject/RefHashRing.js +12 -12
- package/dist/RefSubject/RefHashSet.d.ts +21 -21
- package/dist/RefSubject/RefHashSet.js +20 -20
- package/dist/RefSubject/RefIterable.d.ts +30 -30
- package/dist/RefSubject/RefIterable.js +29 -29
- package/dist/RefSubject/RefOption.d.ts +13 -13
- package/dist/RefSubject/RefOption.js +12 -12
- package/dist/RefSubject/RefRecord.d.ts +31 -31
- package/dist/RefSubject/RefRecord.js +30 -30
- package/dist/RefSubject/RefResult.d.ts +12 -12
- package/dist/RefSubject/RefResult.js +11 -11
- package/dist/RefSubject/RefString.d.ts +17 -17
- package/dist/RefSubject/RefString.js +16 -16
- package/dist/RefSubject/RefStruct.d.ts +13 -13
- package/dist/RefSubject/RefStruct.js +12 -12
- package/dist/RefSubject/RefSubject.d.ts +93 -94
- package/dist/RefSubject/RefSubject.d.ts.map +1 -1
- package/dist/RefSubject/RefSubject.js +132 -77
- package/dist/RefSubject/RefTrie.d.ts +26 -26
- package/dist/RefSubject/RefTrie.js +25 -25
- package/dist/RefSubject/RefTuple.d.ts +11 -11
- package/dist/RefSubject/RefTuple.js +9 -9
- package/dist/Sink/Sink.d.ts +21 -19
- package/dist/Sink/Sink.d.ts.map +1 -1
- package/dist/Sink/Sink.js +5 -4
- package/dist/Sink/combinators.d.ts +33 -33
- package/dist/Sink/combinators.js +32 -32
- package/dist/Subject/Subject.d.ts +14 -13
- package/dist/Subject/Subject.d.ts.map +1 -1
- package/dist/Subject/Subject.js +11 -10
- package/dist/Versioned/Versioned.d.ts +31 -28
- package/dist/Versioned/Versioned.d.ts.map +1 -1
- package/dist/Versioned/Versioned.js +45 -37
- package/package.json +2 -1
package/dist/Fx/Fx.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ import { FxTypeId } from "./TypeId.js";
|
|
|
63
63
|
* ```
|
|
64
64
|
*
|
|
65
65
|
* @since 1.0.0
|
|
66
|
-
* @category
|
|
66
|
+
* @category Type contracts
|
|
67
67
|
*/
|
|
68
68
|
export interface Fx<A, E = never, R = never> extends Pipeable {
|
|
69
69
|
/**
|
|
@@ -210,7 +210,7 @@ export declare namespace Fx {
|
|
|
210
210
|
*
|
|
211
211
|
* This conditional type performs no runtime work.
|
|
212
212
|
* @since 1.0.0
|
|
213
|
-
* @category
|
|
213
|
+
* @category Type contracts
|
|
214
214
|
*/
|
|
215
215
|
type Success<T> = [T] extends [never] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _A : never;
|
|
216
216
|
/**
|
|
@@ -226,7 +226,7 @@ export declare namespace Fx {
|
|
|
226
226
|
*
|
|
227
227
|
* This conditional type performs no runtime work.
|
|
228
228
|
* @since 1.0.0
|
|
229
|
-
* @category
|
|
229
|
+
* @category Type contracts
|
|
230
230
|
*/
|
|
231
231
|
type Error<T> = [T] extends [never] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _E : never;
|
|
232
232
|
/**
|
|
@@ -242,7 +242,7 @@ export declare namespace Fx {
|
|
|
242
242
|
*
|
|
243
243
|
* This conditional type performs no runtime work.
|
|
244
244
|
* @since 1.0.0
|
|
245
|
-
* @category
|
|
245
|
+
* @category Type contracts
|
|
246
246
|
*/
|
|
247
247
|
type Services<T> = [T] extends [never] ? never : [T] extends [Fx<infer _A, infer _E, infer _R>] ? _R : never;
|
|
248
248
|
/**
|
|
@@ -269,7 +269,7 @@ export declare namespace Fx {
|
|
|
269
269
|
* ```
|
|
270
270
|
*
|
|
271
271
|
* @since 1.0.0
|
|
272
|
-
* @category
|
|
272
|
+
* @category Providing services
|
|
273
273
|
*/
|
|
274
274
|
interface Service<Self, Id extends string, A, E> extends Fx<A, E, Self> {
|
|
275
275
|
/**
|
|
@@ -380,7 +380,7 @@ export declare namespace Fx {
|
|
|
380
380
|
*
|
|
381
381
|
* This type alias performs no runtime work.
|
|
382
382
|
* @since 1.0.0
|
|
383
|
-
* @category
|
|
383
|
+
* @category Type contracts
|
|
384
384
|
*/
|
|
385
385
|
export type Success<T> = Fx.Success<T>;
|
|
386
386
|
/**
|
|
@@ -395,7 +395,7 @@ export type Success<T> = Fx.Success<T>;
|
|
|
395
395
|
*
|
|
396
396
|
* This type alias performs no runtime work.
|
|
397
397
|
* @since 1.0.0
|
|
398
|
-
* @category
|
|
398
|
+
* @category Type contracts
|
|
399
399
|
*/
|
|
400
400
|
export type Error<T> = Fx.Error<T>;
|
|
401
401
|
/**
|
|
@@ -410,7 +410,7 @@ export type Error<T> = Fx.Error<T>;
|
|
|
410
410
|
*
|
|
411
411
|
* This type alias performs no runtime work.
|
|
412
412
|
* @since 1.0.0
|
|
413
|
-
* @category
|
|
413
|
+
* @category Type contracts
|
|
414
414
|
*/
|
|
415
415
|
export type Services<T> = Fx.Services<T>;
|
|
416
416
|
/**
|
|
@@ -442,7 +442,7 @@ export type Services<T> = Fx.Services<T>;
|
|
|
442
442
|
* ```
|
|
443
443
|
*
|
|
444
444
|
* @since 1.0.0
|
|
445
|
-
* @category
|
|
445
|
+
* @category Providing services
|
|
446
446
|
*/
|
|
447
447
|
export declare function Service<Self, A, E = never>(): <const Id extends string>(id: Id) => Fx.Class<Self, Id, A, E>;
|
|
448
448
|
//# sourceMappingURL=Fx.d.ts.map
|
package/dist/Fx/Fx.js
CHANGED
package/dist/Fx/TypeId.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type { Fx } from "./Fx.js";
|
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
* @since 1.0.0
|
|
23
|
-
* @category
|
|
23
|
+
* @category Runtime inspection
|
|
24
24
|
*/
|
|
25
25
|
export declare const FxTypeId: unique symbol;
|
|
26
26
|
/**
|
|
@@ -35,7 +35,7 @@ export declare const FxTypeId: unique symbol;
|
|
|
35
35
|
*
|
|
36
36
|
* This alias performs no runtime work.
|
|
37
37
|
* @since 1.0.0
|
|
38
|
-
* @category
|
|
38
|
+
* @category Runtime inspection
|
|
39
39
|
*/
|
|
40
40
|
export type FxTypeId = typeof FxTypeId;
|
|
41
41
|
/**
|
|
@@ -60,7 +60,7 @@ export type FxTypeId = typeof FxTypeId;
|
|
|
60
60
|
* ```
|
|
61
61
|
*
|
|
62
62
|
* @since 1.0.0
|
|
63
|
-
* @category
|
|
63
|
+
* @category Runtime inspection
|
|
64
64
|
*/
|
|
65
65
|
export declare function isFx(u: unknown): u is Fx<any, any, any>;
|
|
66
66
|
//# sourceMappingURL=TypeId.d.ts.map
|
package/dist/Fx/TypeId.js
CHANGED
|
@@ -20,7 +20,7 @@ import { hasProperty } from "effect/Predicate";
|
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
* @since 1.0.0
|
|
23
|
-
* @category
|
|
23
|
+
* @category Runtime inspection
|
|
24
24
|
*/
|
|
25
25
|
export const FxTypeId = Symbol.for("@typed/fx/Fx");
|
|
26
26
|
/**
|
|
@@ -45,7 +45,7 @@ export const FxTypeId = Symbol.for("@typed/fx/Fx");
|
|
|
45
45
|
* ```
|
|
46
46
|
*
|
|
47
47
|
* @since 1.0.0
|
|
48
|
-
* @category
|
|
48
|
+
* @category Runtime inspection
|
|
49
49
|
*/
|
|
50
50
|
export function isFx(u) {
|
|
51
51
|
return hasProperty(u, FxTypeId);
|
|
@@ -38,7 +38,7 @@ import type { Fx } from "../Fx.js";
|
|
|
38
38
|
* @param that - The second Fx stream.
|
|
39
39
|
* @returns An Fx that emits values from both streams.
|
|
40
40
|
* @since 1.0.0
|
|
41
|
-
* @category
|
|
41
|
+
* @category Combining sources
|
|
42
42
|
*/
|
|
43
43
|
export declare const merge: {
|
|
44
44
|
<A2, E2, R2>(that: Fx<A2, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;
|
|
@@ -85,7 +85,7 @@ export declare const merge: {
|
|
|
85
85
|
* @param that - The second Fx stream (run after the first completes).
|
|
86
86
|
* @returns An Fx that emits values from the first stream, then the second.
|
|
87
87
|
* @since 1.0.0
|
|
88
|
-
* @category
|
|
88
|
+
* @category Combining sources
|
|
89
89
|
*/
|
|
90
90
|
export declare const concat: {
|
|
91
91
|
<A2, E2, R2>(that: Fx<A2, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;
|
|
@@ -126,7 +126,7 @@ export declare const concat: {
|
|
|
126
126
|
* @param that - The second Fx stream.
|
|
127
127
|
* @returns An Fx that emits values from the left stream only.
|
|
128
128
|
* @since 1.0.0
|
|
129
|
-
* @category
|
|
129
|
+
* @category Combining sources
|
|
130
130
|
*/
|
|
131
131
|
export declare const zipLeft: {
|
|
132
132
|
<A2, E2, R2>(that: Fx<A2, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E | E2, R | R2>;
|
|
@@ -162,7 +162,7 @@ export declare const zipLeft: {
|
|
|
162
162
|
* @param that - The second Fx stream.
|
|
163
163
|
* @returns An Fx that emits values from the right stream only.
|
|
164
164
|
* @since 1.0.0
|
|
165
|
-
* @category
|
|
165
|
+
* @category Combining sources
|
|
166
166
|
*/
|
|
167
167
|
export declare const zipRight: {
|
|
168
168
|
<A2, E2, R2>(that: Fx<A2, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A2, E | E2, R | R2>;
|
|
@@ -199,7 +199,7 @@ export declare const zipRight: {
|
|
|
199
199
|
* @param that - The second Fx stream (values are dropped).
|
|
200
200
|
* @returns An Fx that emits only values from the left stream.
|
|
201
201
|
* @since 1.0.0
|
|
202
|
-
* @category
|
|
202
|
+
* @category Combining sources
|
|
203
203
|
*/
|
|
204
204
|
export declare const mergeLeft: {
|
|
205
205
|
<A2, E2, R2>(that: Fx<A2, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E | E2, R | R2>;
|
|
@@ -236,7 +236,7 @@ export declare const mergeLeft: {
|
|
|
236
236
|
* @param that - The second Fx stream.
|
|
237
237
|
* @returns An Fx that emits only values from the right stream.
|
|
238
238
|
* @since 1.0.0
|
|
239
|
-
* @category
|
|
239
|
+
* @category Combining sources
|
|
240
240
|
*/
|
|
241
241
|
export declare const mergeRight: {
|
|
242
242
|
<A2, E2, R2>(that: Fx<A2, E2, R2>): <A, E, R>(self: Fx<A, E, R>) => Fx<A2, E | E2, R | R2>;
|
|
@@ -43,7 +43,7 @@ import { zip } from "./zip.js";
|
|
|
43
43
|
* @param that - The second Fx stream.
|
|
44
44
|
* @returns An Fx that emits values from both streams.
|
|
45
45
|
* @since 1.0.0
|
|
46
|
-
* @category
|
|
46
|
+
* @category Combining sources
|
|
47
47
|
*/
|
|
48
48
|
export const merge = dual(2, (self, that) => mergeAll(self, that));
|
|
49
49
|
/**
|
|
@@ -87,7 +87,7 @@ export const merge = dual(2, (self, that) => mergeAll(self, that));
|
|
|
87
87
|
* @param that - The second Fx stream (run after the first completes).
|
|
88
88
|
* @returns An Fx that emits values from the first stream, then the second.
|
|
89
89
|
* @since 1.0.0
|
|
90
|
-
* @category
|
|
90
|
+
* @category Combining sources
|
|
91
91
|
*/
|
|
92
92
|
export const concat = dual(2, (self, that) => continueWith(self, () => that));
|
|
93
93
|
/**
|
|
@@ -125,7 +125,7 @@ export const concat = dual(2, (self, that) => continueWith(self, () => that));
|
|
|
125
125
|
* @param that - The second Fx stream.
|
|
126
126
|
* @returns An Fx that emits values from the left stream only.
|
|
127
127
|
* @since 1.0.0
|
|
128
|
-
* @category
|
|
128
|
+
* @category Combining sources
|
|
129
129
|
*/
|
|
130
130
|
export const zipLeft = dual(2, (self, that) => map(zip(self, that), (pair) => pair[0]));
|
|
131
131
|
/**
|
|
@@ -158,7 +158,7 @@ export const zipLeft = dual(2, (self, that) => map(zip(self, that), (pair) => pa
|
|
|
158
158
|
* @param that - The second Fx stream.
|
|
159
159
|
* @returns An Fx that emits values from the right stream only.
|
|
160
160
|
* @since 1.0.0
|
|
161
|
-
* @category
|
|
161
|
+
* @category Combining sources
|
|
162
162
|
*/
|
|
163
163
|
export const zipRight = dual(2, (self, that) => map(zip(self, that), (pair) => pair[1]));
|
|
164
164
|
/**
|
|
@@ -192,7 +192,7 @@ export const zipRight = dual(2, (self, that) => map(zip(self, that), (pair) => p
|
|
|
192
192
|
* @param that - The second Fx stream (values are dropped).
|
|
193
193
|
* @returns An Fx that emits only values from the left stream.
|
|
194
194
|
* @since 1.0.0
|
|
195
|
-
* @category
|
|
195
|
+
* @category Combining sources
|
|
196
196
|
*/
|
|
197
197
|
export const mergeLeft = dual(2, (self, that) => {
|
|
198
198
|
const taggedLeft = map(self, (a) => ({ _tag: "Left", value: a }));
|
|
@@ -232,7 +232,7 @@ export const mergeLeft = dual(2, (self, that) => {
|
|
|
232
232
|
* @param that - The second Fx stream.
|
|
233
233
|
* @returns An Fx that emits only values from the right stream.
|
|
234
234
|
* @since 1.0.0
|
|
235
|
-
* @category
|
|
235
|
+
* @category Combining sources
|
|
236
236
|
*/
|
|
237
237
|
export const mergeRight = dual(2, (self, that) => {
|
|
238
238
|
const taggedLeft = map(self, (a) => ({ _tag: "Left", value: a }));
|
|
@@ -40,7 +40,7 @@ import type { Fx } from "../Fx.js";
|
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* @since 1.0.0
|
|
43
|
-
* @category
|
|
43
|
+
* @category Errors and recovery
|
|
44
44
|
*/
|
|
45
45
|
export declare const catch_: {
|
|
46
46
|
<E, A2, E2, R2>(f: (e: E) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2, R | R2>;
|
|
@@ -71,7 +71,7 @@ export { catch_ as catch };
|
|
|
71
71
|
* ```
|
|
72
72
|
*
|
|
73
73
|
* @since 1.0.0
|
|
74
|
-
* @category
|
|
74
|
+
* @category Errors and recovery
|
|
75
75
|
*/
|
|
76
76
|
export declare const catchAll: {
|
|
77
77
|
<E, A2, E2, R2>(f: (e: E) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2, R | R2>;
|
|
@@ -108,7 +108,7 @@ export declare const catchAll: {
|
|
|
108
108
|
* ```
|
|
109
109
|
*
|
|
110
110
|
* @since 1.0.0
|
|
111
|
-
* @category
|
|
111
|
+
* @category Errors and recovery
|
|
112
112
|
*/
|
|
113
113
|
export declare const catchCause: {
|
|
114
114
|
<E, A2, E2, R2>(f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2, R | R2>;
|
|
@@ -143,7 +143,7 @@ export declare const catchCause: {
|
|
|
143
143
|
* ```
|
|
144
144
|
*
|
|
145
145
|
* @since 1.0.0
|
|
146
|
-
* @category
|
|
146
|
+
* @category Errors and recovery
|
|
147
147
|
*/
|
|
148
148
|
export declare const catchTag: {
|
|
149
149
|
<const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, E, A2, E2, R2>(k: K, f: (e: ExtractTag<NoInfer<E>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;
|
|
@@ -176,7 +176,7 @@ export declare const catchTag: {
|
|
|
176
176
|
* ```
|
|
177
177
|
*
|
|
178
178
|
* @since 1.0.0
|
|
179
|
-
* @category
|
|
179
|
+
* @category Errors and recovery
|
|
180
180
|
*/
|
|
181
181
|
export declare const catchIf: {
|
|
182
182
|
<E, A2, E2, R2>(predicate: (e: E) => boolean, f: (e: E) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;
|
|
@@ -212,7 +212,7 @@ export declare const catchIf: {
|
|
|
212
212
|
* ```
|
|
213
213
|
*
|
|
214
214
|
* @since 1.0.0
|
|
215
|
-
* @category
|
|
215
|
+
* @category Errors and recovery
|
|
216
216
|
*/
|
|
217
217
|
export declare const catchCauseIf: {
|
|
218
218
|
<E, A2, E2, R2>(predicate: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;
|
|
@@ -262,7 +262,7 @@ type CaseServices<T> = T extends (error: never) => Fx<infer _A, infer _E, infer
|
|
|
262
262
|
* ```
|
|
263
263
|
*
|
|
264
264
|
* @since 1.0.0
|
|
265
|
-
* @category
|
|
265
|
+
* @category Errors and recovery
|
|
266
266
|
*/
|
|
267
267
|
export declare const catchTags: {
|
|
268
268
|
<E, Cases extends TaggedCase<E>>(cases: Cases): <A, R>(self: Fx<A, E, R>) => Fx<A | {
|
|
@@ -52,7 +52,7 @@ const matchesTag = (tag, error) => {
|
|
|
52
52
|
* ```
|
|
53
53
|
*
|
|
54
54
|
* @since 1.0.0
|
|
55
|
-
* @category
|
|
55
|
+
* @category Errors and recovery
|
|
56
56
|
*/
|
|
57
57
|
export const catch_ = dual(2, (self, f) => make((sink) => self.run(makeSink((cause) => {
|
|
58
58
|
const result = Cause.findFail(cause);
|
|
@@ -86,7 +86,7 @@ export { catch_ as catch };
|
|
|
86
86
|
* ```
|
|
87
87
|
*
|
|
88
88
|
* @since 1.0.0
|
|
89
|
-
* @category
|
|
89
|
+
* @category Errors and recovery
|
|
90
90
|
*/
|
|
91
91
|
export const catchAll = catch_;
|
|
92
92
|
/**
|
|
@@ -120,7 +120,7 @@ export const catchAll = catch_;
|
|
|
120
120
|
* ```
|
|
121
121
|
*
|
|
122
122
|
* @since 1.0.0
|
|
123
|
-
* @category
|
|
123
|
+
* @category Errors and recovery
|
|
124
124
|
*/
|
|
125
125
|
export const catchCause = dual(2, (self, f) => make((sink) => self.run(makeSink((cause) => f(cause).run(sink), sink.onSuccess))));
|
|
126
126
|
/**
|
|
@@ -152,7 +152,7 @@ export const catchCause = dual(2, (self, f) => make((sink) => self.run(makeSink(
|
|
|
152
152
|
* ```
|
|
153
153
|
*
|
|
154
154
|
* @since 1.0.0
|
|
155
|
-
* @category
|
|
155
|
+
* @category Errors and recovery
|
|
156
156
|
*/
|
|
157
157
|
export const catchTag = dual(3, (self, k, f) => make((sink) => self.run(makeSink((cause) => {
|
|
158
158
|
const result = Cause.findFail(cause);
|
|
@@ -193,7 +193,7 @@ export const catchTag = dual(3, (self, k, f) => make((sink) => self.run(makeSink
|
|
|
193
193
|
* ```
|
|
194
194
|
*
|
|
195
195
|
* @since 1.0.0
|
|
196
|
-
* @category
|
|
196
|
+
* @category Errors and recovery
|
|
197
197
|
*/
|
|
198
198
|
export const catchIf = dual(3, (self, predicate, f) => make((sink) => self.run(makeSink((cause) => {
|
|
199
199
|
const result = Cause.findFail(cause);
|
|
@@ -236,7 +236,7 @@ export const catchIf = dual(3, (self, predicate, f) => make((sink) => self.run(m
|
|
|
236
236
|
* ```
|
|
237
237
|
*
|
|
238
238
|
* @since 1.0.0
|
|
239
|
-
* @category
|
|
239
|
+
* @category Errors and recovery
|
|
240
240
|
*/
|
|
241
241
|
export const catchCauseIf = dual(3, (self, predicate, f) => make((sink) => self.run(makeSink((cause) => (predicate(cause) ? f(cause).run(sink) : sink.onFailure(cause)), sink.onSuccess))));
|
|
242
242
|
/**
|
|
@@ -273,7 +273,7 @@ export const catchCauseIf = dual(3, (self, predicate, f) => make((sink) => self.
|
|
|
273
273
|
* ```
|
|
274
274
|
*
|
|
275
275
|
* @since 1.0.0
|
|
276
|
-
* @category
|
|
276
|
+
* @category Errors and recovery
|
|
277
277
|
*/
|
|
278
278
|
export const catchTags = dual(2, (self, cases) => make((sink) => self.run(makeSink((cause) => {
|
|
279
279
|
const result = Cause.findFail(cause);
|
|
@@ -29,7 +29,7 @@ import type { Fx } from "../Fx.js";
|
|
|
29
29
|
* @param fx - The `Fx` stream.
|
|
30
30
|
* @returns An `Fx` emitting `Cause<E>`.
|
|
31
31
|
* @since 1.0.0
|
|
32
|
-
* @category
|
|
32
|
+
* @category Errors and recovery
|
|
33
33
|
*/
|
|
34
34
|
export declare const causes: <A, E, R>(fx: Fx<A, E, R>) => Fx<Cause.Cause<E>, never, R>;
|
|
35
35
|
//# sourceMappingURL=causes.d.ts.map
|
|
@@ -31,7 +31,7 @@ import { filterMap } from "./filterMap.js";
|
|
|
31
31
|
* @param fx - The `Fx` stream.
|
|
32
32
|
* @returns An `Fx` emitting `Cause<E>`.
|
|
33
33
|
* @since 1.0.0
|
|
34
|
-
* @category
|
|
34
|
+
* @category Errors and recovery
|
|
35
35
|
*/
|
|
36
36
|
export const causes = (fx) => filterMap(exit(fx), Exit.match({
|
|
37
37
|
onFailure: Option.some,
|
|
@@ -31,7 +31,7 @@ import type { Fx } from "../Fx.js";
|
|
|
31
31
|
* @param f - Effectful function: `(prev, next) => Effect<boolean>`. Return `true` to skip (treat as duplicate), `false` to emit.
|
|
32
32
|
* @returns An `Fx` with consecutive "equal" elements removed.
|
|
33
33
|
* @since 1.0.0
|
|
34
|
-
* @category
|
|
34
|
+
* @category Selecting values
|
|
35
35
|
*/
|
|
36
36
|
export declare const changesWithEffect: {
|
|
37
37
|
<A, E2, R2>(f: (prev: A, next: A) => Effect.Effect<boolean, E2, R2>): <E, R>(fx: Fx<A, E | E2, R>) => Fx<A, E | E2, R | R2>;
|
|
@@ -35,7 +35,7 @@ import { make } from "../constructors/make.js";
|
|
|
35
35
|
* @param f - Effectful function: `(prev, next) => Effect<boolean>`. Return `true` to skip (treat as duplicate), `false` to emit.
|
|
36
36
|
* @returns An `Fx` with consecutive "equal" elements removed.
|
|
37
37
|
* @since 1.0.0
|
|
38
|
-
* @category
|
|
38
|
+
* @category Selecting values
|
|
39
39
|
*/
|
|
40
40
|
export const changesWithEffect = dual(2, (fx, f) => make((sink) => sinkCore.withStateSemaphore(sink, Option.none(), (s) => fx.run(makeSink(s.onFailure, (a2) => Effect.matchCauseEffect(Effect.flatMap(s.get, (state) => Option.match(state, {
|
|
41
41
|
onNone: () => Effect.flatMap(s.onSuccess(a2), () => s.updateEffect(() => Effect.succeed(Option.some(a2)))),
|
|
@@ -23,7 +23,7 @@ import type { Fx } from "../Fx.js";
|
|
|
23
23
|
* @param self - An `Fx` emitting `Option<A>`.
|
|
24
24
|
* @returns An `Fx` emitting `A`.
|
|
25
25
|
* @since 1.0.0
|
|
26
|
-
* @category
|
|
26
|
+
* @category Selecting values
|
|
27
27
|
*/
|
|
28
28
|
export declare const compact: <A, E, R>(self: Fx<Option.Option<A>, E, R>) => Fx<A, E, R>;
|
|
29
29
|
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -23,6 +23,6 @@ import { make } from "../constructors/make.js";
|
|
|
23
23
|
* @param self - An `Fx` emitting `Option<A>`.
|
|
24
24
|
* @returns An `Fx` emitting `A`.
|
|
25
25
|
* @since 1.0.0
|
|
26
|
-
* @category
|
|
26
|
+
* @category Selecting values
|
|
27
27
|
*/
|
|
28
28
|
export const compact = (self) => make((sink) => self.run(sinkCore.compact(sink)));
|
|
@@ -39,7 +39,7 @@ import type { FlatMapEffectLike } from "./flatMapEffect.js";
|
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
41
41
|
* @since 1.0.0
|
|
42
|
-
* @category
|
|
42
|
+
* @category Concurrent work
|
|
43
43
|
*/
|
|
44
44
|
export declare const concatMap: FlatMapLike;
|
|
45
45
|
/**
|
|
@@ -80,7 +80,7 @@ export declare const concatMap: FlatMapLike;
|
|
|
80
80
|
* ```
|
|
81
81
|
*
|
|
82
82
|
* @since 1.0.0
|
|
83
|
-
* @category
|
|
83
|
+
* @category Concurrent work
|
|
84
84
|
*/
|
|
85
85
|
export declare const concatMapEffect: FlatMapEffectLike;
|
|
86
86
|
//# sourceMappingURL=concatMap.d.ts.map
|
|
@@ -40,7 +40,7 @@ import { flatMapConcurrently } from "./flatMapConcurrently.js";
|
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* @since 1.0.0
|
|
43
|
-
* @category
|
|
43
|
+
* @category Concurrent work
|
|
44
44
|
*/
|
|
45
45
|
export const concatMap = dual(2, (self, f) => flatMapConcurrently(self, f, 1));
|
|
46
46
|
/**
|
|
@@ -81,6 +81,6 @@ export const concatMap = dual(2, (self, f) => flatMapConcurrently(self, f, 1));
|
|
|
81
81
|
* ```
|
|
82
82
|
*
|
|
83
83
|
* @since 1.0.0
|
|
84
|
-
* @category
|
|
84
|
+
* @category Concurrent work
|
|
85
85
|
*/
|
|
86
86
|
export const concatMapEffect = dual(2, (self, f) => concatMap(self, flow(f, fromEffect)));
|
|
@@ -43,7 +43,7 @@ import type { Fx } from "../Fx.js";
|
|
|
43
43
|
* @param f - A function that returns the next Fx to run.
|
|
44
44
|
* @returns An `Fx` that emits values from the first Fx, then from the second Fx.
|
|
45
45
|
* @since 1.0.0
|
|
46
|
-
* @category
|
|
46
|
+
* @category Combining sources
|
|
47
47
|
*/
|
|
48
48
|
export declare const continueWith: {
|
|
49
49
|
<B, E2, R2>(f: () => Fx<B, E2, R2>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A | B, E | E2, R | R2>;
|
|
@@ -79,7 +79,7 @@ export declare const continueWith: {
|
|
|
79
79
|
* @param value - The value to append.
|
|
80
80
|
* @returns An `Fx` that emits values from the input Fx, then the appended value.
|
|
81
81
|
* @since 1.0.0
|
|
82
|
-
* @category
|
|
82
|
+
* @category Combining sources
|
|
83
83
|
*/
|
|
84
84
|
export declare const append: {
|
|
85
85
|
<B>(value: B): <A, E, R>(fx: Fx<A, E, R>) => Fx<A | B, E, R>;
|
|
@@ -114,7 +114,7 @@ export declare const append: {
|
|
|
114
114
|
* @param value - The value to prepend.
|
|
115
115
|
* @returns An `Fx` that emits the prepended value, then values from the input Fx.
|
|
116
116
|
* @since 1.0.0
|
|
117
|
-
* @category
|
|
117
|
+
* @category Combining sources
|
|
118
118
|
*/
|
|
119
119
|
export declare const prepend: {
|
|
120
120
|
<B>(value: B): <A, E, R>(fx: Fx<A, E, R>) => Fx<B | A, E, R>;
|
|
@@ -150,7 +150,7 @@ export declare const prepend: {
|
|
|
150
150
|
* @param after - The value to emit after the Fx completes.
|
|
151
151
|
* @returns An `Fx` that emits `before`, then values from the input Fx, then `after`.
|
|
152
152
|
* @since 1.0.0
|
|
153
|
-
* @category
|
|
153
|
+
* @category Combining sources
|
|
154
154
|
*/
|
|
155
155
|
export declare const delimit: {
|
|
156
156
|
<B, C>(before: B, after: C): <A, E, R>(fx: Fx<A, E, R>) => Fx<A | B | C, E, R>;
|
|
@@ -46,7 +46,7 @@ import { succeed } from "../constructors/succeed.js";
|
|
|
46
46
|
* @param f - A function that returns the next Fx to run.
|
|
47
47
|
* @returns An `Fx` that emits values from the first Fx, then from the second Fx.
|
|
48
48
|
* @since 1.0.0
|
|
49
|
-
* @category
|
|
49
|
+
* @category Combining sources
|
|
50
50
|
*/
|
|
51
51
|
export const continueWith = dual(2, (fx, f) => make((sink) => Effect.flatMap(fx.run(sink), () => f().run(sink))));
|
|
52
52
|
/**
|
|
@@ -79,7 +79,7 @@ export const continueWith = dual(2, (fx, f) => make((sink) => Effect.flatMap(fx.
|
|
|
79
79
|
* @param value - The value to append.
|
|
80
80
|
* @returns An `Fx` that emits values from the input Fx, then the appended value.
|
|
81
81
|
* @since 1.0.0
|
|
82
|
-
* @category
|
|
82
|
+
* @category Combining sources
|
|
83
83
|
*/
|
|
84
84
|
export const append = dual(2, (fx, value) => continueWith(fx, () => succeed(value)));
|
|
85
85
|
/**
|
|
@@ -111,7 +111,7 @@ export const append = dual(2, (fx, value) => continueWith(fx, () => succeed(valu
|
|
|
111
111
|
* @param value - The value to prepend.
|
|
112
112
|
* @returns An `Fx` that emits the prepended value, then values from the input Fx.
|
|
113
113
|
* @since 1.0.0
|
|
114
|
-
* @category
|
|
114
|
+
* @category Combining sources
|
|
115
115
|
*/
|
|
116
116
|
export const prepend = dual(2, (fx, value) => continueWith(succeed(value), () => fx));
|
|
117
117
|
/**
|
|
@@ -144,6 +144,6 @@ export const prepend = dual(2, (fx, value) => continueWith(succeed(value), () =>
|
|
|
144
144
|
* @param after - The value to emit after the Fx completes.
|
|
145
145
|
* @returns An `Fx` that emits `before`, then values from the input Fx, then `after`.
|
|
146
146
|
* @since 1.0.0
|
|
147
|
-
* @category
|
|
147
|
+
* @category Combining sources
|
|
148
148
|
*/
|
|
149
149
|
export const delimit = dual(3, (fx, before, after) => fx.pipe(prepend(before), append(after)));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Duration, Scope } from "effect";
|
|
2
|
-
import { Fx } from "../Fx.js";
|
|
2
|
+
import type { Fx } from "../Fx.js";
|
|
3
3
|
/**
|
|
4
4
|
* Emits a value only after no newer source value arrives for `duration`.
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@ import { Fx } from "../Fx.js";
|
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
27
|
* @since 1.0.0
|
|
28
|
-
* @category
|
|
28
|
+
* @category Time and rate
|
|
29
29
|
*/
|
|
30
30
|
export declare const debounce: {
|
|
31
31
|
(duration: Duration.Input): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R | Scope.Scope>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/debounce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/debounce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAKnC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,QAAQ,EAAE;IACrB,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACpF,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;CAUjF,CAAC"}
|
|
@@ -27,7 +27,7 @@ import { dual } from "effect/Function";
|
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
29
|
* @since 1.0.0
|
|
30
|
-
* @category
|
|
30
|
+
* @category Time and rate
|
|
31
31
|
*/
|
|
32
32
|
export const debounce = dual(2, (fx, duration) => switchMap(fx, (a) => make(Effect.fn(function* (sink) {
|
|
33
33
|
yield* Effect.sleep(duration);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Fx } from "../Fx.js";
|
|
1
|
+
import type { Fx } from "../Fx.js";
|
|
2
2
|
import { Duration } from "effect";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Sleeps for `duration` before forwarding each successful source delivery.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
7
|
* ## Why
|
|
@@ -11,10 +11,12 @@ import { Duration } from "effect";
|
|
|
11
11
|
*
|
|
12
12
|
* ## Ownership and lifetime
|
|
13
13
|
*
|
|
14
|
-
* Each delivered value runs an Effect sleep before reaching the sink.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Each delivered value runs an Effect sleep before reaching the sink. This uses
|
|
15
|
+
* `mapEffect` and inherits producer concurrency: a sequential producer waits for
|
|
16
|
+
* each delayed delivery, while concurrent deliveries can overlap their sleeps.
|
|
17
|
+
* No queue or ordering guarantee is added. The source run must await its pending
|
|
18
|
+
* deliveries before normal completion. Source failures propagate; interruption
|
|
19
|
+
* cancels active sleeps. No external resource is retained.
|
|
18
20
|
*
|
|
19
21
|
* @example
|
|
20
22
|
* ```ts
|
|
@@ -25,7 +27,7 @@ import { Duration } from "effect";
|
|
|
25
27
|
* ```
|
|
26
28
|
*
|
|
27
29
|
* @since 1.0.0
|
|
28
|
-
* @category
|
|
30
|
+
* @category Time and rate
|
|
29
31
|
*/
|
|
30
32
|
export declare const delay: {
|
|
31
33
|
(duration: Duration.Input): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E, R>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/delay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/delay.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAU,MAAM,QAAQ,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,KAAK,EAAE;IAClB,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAGrE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { dual } from "effect/Function";
|
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { mapEffect } from "./mapEffect.js";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Sleeps for `duration` before forwarding each successful source delivery.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* ## Why
|
|
@@ -12,10 +12,12 @@ import { mapEffect } from "./mapEffect.js";
|
|
|
12
12
|
*
|
|
13
13
|
* ## Ownership and lifetime
|
|
14
14
|
*
|
|
15
|
-
* Each delivered value runs an Effect sleep before reaching the sink.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Each delivered value runs an Effect sleep before reaching the sink. This uses
|
|
16
|
+
* `mapEffect` and inherits producer concurrency: a sequential producer waits for
|
|
17
|
+
* each delayed delivery, while concurrent deliveries can overlap their sleeps.
|
|
18
|
+
* No queue or ordering guarantee is added. The source run must await its pending
|
|
19
|
+
* deliveries before normal completion. Source failures propagate; interruption
|
|
20
|
+
* cancels active sleeps. No external resource is retained.
|
|
19
21
|
*
|
|
20
22
|
* @example
|
|
21
23
|
* ```ts
|
|
@@ -26,6 +28,6 @@ import { mapEffect } from "./mapEffect.js";
|
|
|
26
28
|
* ```
|
|
27
29
|
*
|
|
28
30
|
* @since 1.0.0
|
|
29
|
-
* @category
|
|
31
|
+
* @category Time and rate
|
|
30
32
|
*/
|
|
31
33
|
export const delay = dual(2, (self, duration) => mapEffect(self, (a) => Effect.as(Effect.sleep(duration), a)));
|