@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
|
@@ -27,7 +27,7 @@ import type { Fx } from "../Fx.js";
|
|
|
27
27
|
* @param delay - The duration to wait before emitting.
|
|
28
28
|
* @returns An `Fx` that emits the value after the delay.
|
|
29
29
|
* @since 1.0.0
|
|
30
|
-
* @category
|
|
30
|
+
* @category Time and rate
|
|
31
31
|
*/
|
|
32
32
|
export declare const at: {
|
|
33
33
|
(delay: Duration.Input): <A>(value: A) => Fx<A>;
|
|
@@ -28,6 +28,6 @@ import { make } from "./make.js";
|
|
|
28
28
|
* @param delay - The duration to wait before emitting.
|
|
29
29
|
* @returns An `Fx` that emits the value after the delay.
|
|
30
30
|
* @since 1.0.0
|
|
31
|
-
* @category
|
|
31
|
+
* @category Time and rate
|
|
32
32
|
*/
|
|
33
33
|
export const at = dual(2, (value, delay) => make((sink) => flatMap(sleep(delay), () => sink.onSuccess(value))));
|
|
@@ -26,7 +26,7 @@ import type { Fx } from "../Fx.js";
|
|
|
26
26
|
* @param defect - The defect value.
|
|
27
27
|
* @returns An `Fx` that dies immediately.
|
|
28
28
|
* @since 1.0.0
|
|
29
|
-
* @category
|
|
29
|
+
* @category Failure sources
|
|
30
30
|
*/
|
|
31
31
|
export declare const die: (defect: unknown) => Fx<never, never, never>;
|
|
32
32
|
//# sourceMappingURL=die.d.ts.map
|
|
@@ -28,6 +28,6 @@ import { failCause } from "./failCause.js";
|
|
|
28
28
|
* @param defect - The defect value.
|
|
29
29
|
* @returns An `Fx` that dies immediately.
|
|
30
30
|
* @since 1.0.0
|
|
31
|
-
* @category
|
|
31
|
+
* @category Failure sources
|
|
32
32
|
*/
|
|
33
33
|
export const die = /*#__PURE__*/ flow(Cause.die, failCause);
|
|
@@ -26,7 +26,7 @@ import type { Fx } from "../Fx.js";
|
|
|
26
26
|
* @param error - The error to fail with.
|
|
27
27
|
* @returns An `Fx` that fails immediately.
|
|
28
28
|
* @since 1.0.0
|
|
29
|
-
* @category
|
|
29
|
+
* @category Failure sources
|
|
30
30
|
*/
|
|
31
31
|
export declare const fail: <E>(error: E) => Fx<never, E, never>;
|
|
32
32
|
//# sourceMappingURL=fail.d.ts.map
|
|
@@ -28,6 +28,6 @@ import { failCause } from "./failCause.js";
|
|
|
28
28
|
* @param error - The error to fail with.
|
|
29
29
|
* @returns An `Fx` that fails immediately.
|
|
30
30
|
* @since 1.0.0
|
|
31
|
-
* @category
|
|
31
|
+
* @category Failure sources
|
|
32
32
|
*/
|
|
33
33
|
export const fail = /*#__PURE__*/ flow(Cause.fail, failCause);
|
|
@@ -28,7 +28,7 @@ import type { Fx } from "../Fx.js";
|
|
|
28
28
|
* @param cause - The cause of failure.
|
|
29
29
|
* @returns An `Fx` that terminates with the given cause.
|
|
30
30
|
* @since 1.0.0
|
|
31
|
-
* @category
|
|
31
|
+
* @category Failure sources
|
|
32
32
|
*/
|
|
33
33
|
export declare const failCause: <E>(cause: Cause.Cause<E>) => Fx<never, E, never>;
|
|
34
34
|
//# sourceMappingURL=failCause.d.ts.map
|
|
@@ -27,7 +27,7 @@ import { make } from "./make.js";
|
|
|
27
27
|
* @param cause - The cause of failure.
|
|
28
28
|
* @returns An `Fx` that terminates with the given cause.
|
|
29
29
|
* @since 1.0.0
|
|
30
|
-
* @category
|
|
30
|
+
* @category Failure sources
|
|
31
31
|
*/
|
|
32
32
|
export const failCause = (cause) =>
|
|
33
33
|
/*#__PURE__*/ make((sink) => sink.onFailure(cause));
|
|
@@ -16,7 +16,7 @@ import type { Fx } from "../Fx.js";
|
|
|
16
16
|
* These are type-level contracts. They start no Effect or `Fx` run.
|
|
17
17
|
*
|
|
18
18
|
* @since 1.0.0
|
|
19
|
-
* @category
|
|
19
|
+
* @category Generator composition
|
|
20
20
|
*/
|
|
21
21
|
export declare namespace fn {
|
|
22
22
|
/**
|
|
@@ -47,7 +47,7 @@ export declare namespace fn {
|
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
49
|
* @since 1.0.0
|
|
50
|
-
* @category
|
|
50
|
+
* @category Type contracts
|
|
51
51
|
*/
|
|
52
52
|
type Gen = {
|
|
53
53
|
<Eff extends Effect.Effect<any, any, any>, ReturnFx extends Fx.Any, Args extends Array<any>>(body: (this: unassigned, ...args: Args) => Generator<Eff, ReturnFx>): (...args: Args) => Fx<Fx.Success<ReturnFx>, Fx.Error<ReturnFx> | Effect.Error<Eff>, Fx.Services<ReturnFx> | Effect.Services<Eff>>;
|
|
@@ -92,7 +92,7 @@ export declare namespace fn {
|
|
|
92
92
|
* ```
|
|
93
93
|
*
|
|
94
94
|
* @since 1.0.0
|
|
95
|
-
* @category
|
|
95
|
+
* @category Type contracts
|
|
96
96
|
*/
|
|
97
97
|
type NonGen = {
|
|
98
98
|
<Args extends Array<any>, ReturnFx extends Fx.Any>(body: (this: unassigned, ...args: Args) => ReturnFx): (...args: Args) => ReturnFx;
|
|
@@ -139,7 +139,7 @@ export declare namespace fn {
|
|
|
139
139
|
* ```
|
|
140
140
|
*
|
|
141
141
|
* @since 1.0.0
|
|
142
|
-
* @category
|
|
142
|
+
* @category Generator composition
|
|
143
143
|
*/
|
|
144
144
|
export declare const fn: fn.Gen & fn.NonGen & {
|
|
145
145
|
(name: string, options?: SpanOptionsNoTrace): fn.Gen & fn.NonGen;
|
|
@@ -30,7 +30,7 @@ import type { Fx } from "../Fx.js";
|
|
|
30
30
|
* @param effect - The effect to convert.
|
|
31
31
|
* @returns An `Fx` representing the execution of the effect.
|
|
32
32
|
* @since 1.0.0
|
|
33
|
-
* @category
|
|
33
|
+
* @category Effect interop
|
|
34
34
|
*/
|
|
35
35
|
export declare const fromEffect: <A, E = never, R = never>(effect: Effect.Effect<A, E, R>) => Fx<A, E, R>;
|
|
36
36
|
/**
|
|
@@ -57,7 +57,7 @@ export declare const fromEffect: <A, E = never, R = never>(effect: Effect.Effect
|
|
|
57
57
|
* ```
|
|
58
58
|
*
|
|
59
59
|
* @since 1.0.0
|
|
60
|
-
* @category
|
|
60
|
+
* @category Value sources
|
|
61
61
|
*/
|
|
62
62
|
export declare const never: Fx<never, never, never>;
|
|
63
63
|
//# sourceMappingURL=fromEffect.d.ts.map
|
|
@@ -30,7 +30,7 @@ import { make } from "./make.js";
|
|
|
30
30
|
* @param effect - The effect to convert.
|
|
31
31
|
* @returns An `Fx` representing the execution of the effect.
|
|
32
32
|
* @since 1.0.0
|
|
33
|
-
* @category
|
|
33
|
+
* @category Effect interop
|
|
34
34
|
*/
|
|
35
35
|
export const fromEffect = (effect) =>
|
|
36
36
|
/*#__PURE__*/ make((sink) => Effect.matchCauseEffect(effect, sink));
|
|
@@ -58,6 +58,6 @@ export const fromEffect = (effect) =>
|
|
|
58
58
|
* ```
|
|
59
59
|
*
|
|
60
60
|
* @since 1.0.0
|
|
61
|
-
* @category
|
|
61
|
+
* @category Value sources
|
|
62
62
|
*/
|
|
63
63
|
export const never = make(() => Effect.never);
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* @param failures - An iterable of failures.
|
|
29
29
|
* @returns An `Fx` that fails with the combined failures.
|
|
30
30
|
* @since 1.0.0
|
|
31
|
-
* @category
|
|
31
|
+
* @category Failure sources
|
|
32
32
|
*/
|
|
33
33
|
export declare const fromFailures: <E>(failures: Iterable<E>) => import("../Fx.js").Fx<never, E, never>;
|
|
34
34
|
//# sourceMappingURL=fromFailures.d.ts.map
|
|
@@ -32,6 +32,6 @@ const fromFailuresCause = (failures) => Array.from(failures).reduce((acc, e) =>
|
|
|
32
32
|
* @param failures - An iterable of failures.
|
|
33
33
|
* @returns An `Fx` that fails with the combined failures.
|
|
34
34
|
* @since 1.0.0
|
|
35
|
-
* @category
|
|
35
|
+
* @category Failure sources
|
|
36
36
|
*/
|
|
37
37
|
export const fromFailures = /*#__PURE__*/ flow(fromFailuresCause, failCause);
|
|
@@ -28,7 +28,7 @@ import type { Fx } from "../Fx.js";
|
|
|
28
28
|
* @param iterable - The iterable to emit values from.
|
|
29
29
|
* @returns An `Fx` that emits the values from the iterable.
|
|
30
30
|
* @since 1.0.0
|
|
31
|
-
* @category
|
|
31
|
+
* @category Value sources
|
|
32
32
|
*/
|
|
33
33
|
export declare const fromIterable: <A>(iterable: Iterable<A>) => Fx<A>;
|
|
34
34
|
//# sourceMappingURL=fromIterable.d.ts.map
|
|
@@ -29,6 +29,6 @@ import { make } from "./make.js";
|
|
|
29
29
|
* @param iterable - The iterable to emit values from.
|
|
30
30
|
* @returns An `Fx` that emits the values from the iterable.
|
|
31
31
|
* @since 1.0.0
|
|
32
|
-
* @category
|
|
32
|
+
* @category Value sources
|
|
33
33
|
*/
|
|
34
34
|
export const fromIterable = (iterable) => make((sink) => forEach(iterable, sink.onSuccess, { discard: true }));
|
|
@@ -9,7 +9,9 @@ import type { Fx } from "../Fx.js";
|
|
|
9
9
|
*
|
|
10
10
|
* Effect [Schedule](https://effect.website/docs/v4/api/effect/Schedule) values already
|
|
11
11
|
* encode recurrence, delay, and typed schedule failures. `fromSchedule` exposes
|
|
12
|
-
* those decisions as producer-driven ticks without another timing model.
|
|
12
|
+
* those decisions as producer-driven ticks without another timing model. The
|
|
13
|
+
* schedule governs all ticks: `Schedule.recurs(2)` emits twice here. In contrast,
|
|
14
|
+
* `repeat(source, Schedule.recurs(2))` runs an initial source plus two repeats.
|
|
13
15
|
*
|
|
14
16
|
* ## Ownership and lifetime
|
|
15
17
|
*
|
|
@@ -23,14 +25,14 @@ import type { Fx } from "../Fx.js";
|
|
|
23
25
|
* import { Schedule } from "effect"
|
|
24
26
|
* import { collectAll, fromSchedule } from "@typed/fx/Fx"
|
|
25
27
|
*
|
|
26
|
-
* const
|
|
27
|
-
* const program = collectAll(
|
|
28
|
+
* const twoTicks = fromSchedule(Schedule.recurs(2))
|
|
29
|
+
* const program = collectAll(twoTicks) // [undefined, undefined]
|
|
28
30
|
* ```
|
|
29
31
|
*
|
|
30
32
|
* @param schedule - The schedule to follow.
|
|
31
33
|
* @returns An `Fx` that emits periodically according to the schedule.
|
|
32
34
|
* @since 1.0.0
|
|
33
|
-
* @category
|
|
35
|
+
* @category Time and rate
|
|
34
36
|
*/
|
|
35
37
|
export declare const fromSchedule: <Error, Env>(schedule: Schedule<unknown, unknown, Error, Env>) => Fx<void, Error, Env>;
|
|
36
38
|
//# sourceMappingURL=fromSchedule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromSchedule.d.ts","sourceRoot":"","sources":["../../../src/Fx/constructors/fromSchedule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAGnC
|
|
1
|
+
{"version":3,"file":"fromSchedule.d.ts","sourceRoot":"","sources":["../../../src/Fx/constructors/fromSchedule.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAGnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,EAAE,GAAG,YAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,KAC/C,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAGnB,CAAC"}
|
|
@@ -9,7 +9,9 @@ import { make } from "./make.js";
|
|
|
9
9
|
*
|
|
10
10
|
* Effect [Schedule](https://effect.website/docs/v4/api/effect/Schedule) values already
|
|
11
11
|
* encode recurrence, delay, and typed schedule failures. `fromSchedule` exposes
|
|
12
|
-
* those decisions as producer-driven ticks without another timing model.
|
|
12
|
+
* those decisions as producer-driven ticks without another timing model. The
|
|
13
|
+
* schedule governs all ticks: `Schedule.recurs(2)` emits twice here. In contrast,
|
|
14
|
+
* `repeat(source, Schedule.recurs(2))` runs an initial source plus two repeats.
|
|
13
15
|
*
|
|
14
16
|
* ## Ownership and lifetime
|
|
15
17
|
*
|
|
@@ -23,14 +25,14 @@ import { make } from "./make.js";
|
|
|
23
25
|
* import { Schedule } from "effect"
|
|
24
26
|
* import { collectAll, fromSchedule } from "@typed/fx/Fx"
|
|
25
27
|
*
|
|
26
|
-
* const
|
|
27
|
-
* const program = collectAll(
|
|
28
|
+
* const twoTicks = fromSchedule(Schedule.recurs(2))
|
|
29
|
+
* const program = collectAll(twoTicks) // [undefined, undefined]
|
|
28
30
|
* ```
|
|
29
31
|
*
|
|
30
32
|
* @param schedule - The schedule to follow.
|
|
31
33
|
* @returns An `Fx` that emits periodically according to the schedule.
|
|
32
34
|
* @since 1.0.0
|
|
33
|
-
* @category
|
|
35
|
+
* @category Time and rate
|
|
34
36
|
*/
|
|
35
37
|
export const fromSchedule = (schedule) =>
|
|
36
38
|
/*#__PURE__*/ make((sink) => catchCause(schedule_Effect(sink.onSuccess(), schedule), sink.onFailure));
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* @param id - Optional numeric fiber identifier responsible for the interruption.
|
|
25
25
|
* @returns An `Fx` that is interrupted.
|
|
26
26
|
* @since 1.0.0
|
|
27
|
-
* @category
|
|
27
|
+
* @category Failure sources
|
|
28
28
|
*/
|
|
29
29
|
export declare const interrupt: (fiberId?: number | undefined) => import("../Fx.js").Fx<never, never, never>;
|
|
30
30
|
//# sourceMappingURL=interrupt.d.ts.map
|
|
@@ -27,6 +27,6 @@ import { failCause } from "./failCause.js";
|
|
|
27
27
|
* @param id - Optional numeric fiber identifier responsible for the interruption.
|
|
28
28
|
* @returns An `Fx` that is interrupted.
|
|
29
29
|
* @since 1.0.0
|
|
30
|
-
* @category
|
|
30
|
+
* @category Failure sources
|
|
31
31
|
*/
|
|
32
32
|
export const interrupt = /*#__PURE__*/ flow(Cause.interrupt, failCause);
|
|
@@ -18,10 +18,12 @@ import type { Fx } from "../Fx.js";
|
|
|
18
18
|
*
|
|
19
19
|
* ## Ownership and lifetime
|
|
20
20
|
*
|
|
21
|
-
* `make`
|
|
22
|
-
*
|
|
23
|
-
* inside
|
|
24
|
-
*
|
|
21
|
+
* `make` stores the callback without invoking it. Calling `fx.run(sink)` asks the
|
|
22
|
+
* callback to construct its Effect; executing that Effect performs the subscription.
|
|
23
|
+
* Keep acquisition, publication, and cleanup inside the returned Effect or a required
|
|
24
|
+
* `Scope`, rather than performing side effects while constructing it. The returned
|
|
25
|
+
* Effect has no typed failure channel because producer failures are delivered through
|
|
26
|
+
* `sink.onFailure`; defects and interruption can still affect the run.
|
|
25
27
|
*
|
|
26
28
|
* @example
|
|
27
29
|
* ```ts
|
|
@@ -37,7 +39,7 @@ import type { Fx } from "../Fx.js";
|
|
|
37
39
|
* @param run - A function that takes a `Sink` and returns an `Effect` that drives the stream.
|
|
38
40
|
* @returns An `Fx` instance.
|
|
39
41
|
* @since 1.0.0
|
|
40
|
-
* @category
|
|
42
|
+
* @category Callback sources
|
|
41
43
|
*/
|
|
42
44
|
export declare const make: <A, E = never, R = never>(run: <RSink = never>(sink: Sink<A, E, RSink>) => Effect.Effect<unknown, never, R | RSink>) => Fx<A, E, R>;
|
|
43
45
|
/**
|
|
@@ -56,7 +58,7 @@ export declare const make: <A, E = never, R = never>(run: <RSink = never>(sink:
|
|
|
56
58
|
* inspect or interrupt that delivery. Retaining it after cleanup is unsupported.
|
|
57
59
|
*
|
|
58
60
|
* @since 1.0.0
|
|
59
|
-
* @category
|
|
61
|
+
* @category Callback protocol
|
|
60
62
|
*/
|
|
61
63
|
export type Emit<A, E = never> = {
|
|
62
64
|
/**
|
|
@@ -179,7 +181,7 @@ export type Emit<A, E = never> = {
|
|
|
179
181
|
* It can return a cleanup effect.
|
|
180
182
|
* @returns An `Fx` adapted from the callback.
|
|
181
183
|
* @since 1.0.0
|
|
182
|
-
* @category
|
|
184
|
+
* @category Callback sources
|
|
183
185
|
*/
|
|
184
186
|
export declare const callback: <A, E = never, R = never>(run: (emit: Emit<A, E>) => void | Effect.Effect<unknown, never, R>) => Fx<A, E, R>;
|
|
185
187
|
//# sourceMappingURL=make.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make.d.ts","sourceRoot":"","sources":["../../../src/Fx/constructors/make.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAsBnC
|
|
1
|
+
{"version":3,"file":"make.d.ts","sourceRoot":"","sources":["../../../src/Fx/constructors/make.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAsBnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,OACrC,CAAC,KAAK,GAAG,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,KACxF,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAA2B,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI;IAC/B;;;;;;;;;;;;;;;OAeG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C;;;;;;;;;;;;;;;OAeG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5D;;;;;;;;;;;;;;;OAeG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1C;;;;;;;;;;;;;;;OAeG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC/C;;;;;;;;;;;;;;;OAeG;IACH,IAAI,EAAE,MAAM,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,OACzC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KACjE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CA6BV,CAAC"}
|
|
@@ -35,10 +35,12 @@ class Make {
|
|
|
35
35
|
*
|
|
36
36
|
* ## Ownership and lifetime
|
|
37
37
|
*
|
|
38
|
-
* `make`
|
|
39
|
-
*
|
|
40
|
-
* inside
|
|
41
|
-
*
|
|
38
|
+
* `make` stores the callback without invoking it. Calling `fx.run(sink)` asks the
|
|
39
|
+
* callback to construct its Effect; executing that Effect performs the subscription.
|
|
40
|
+
* Keep acquisition, publication, and cleanup inside the returned Effect or a required
|
|
41
|
+
* `Scope`, rather than performing side effects while constructing it. The returned
|
|
42
|
+
* Effect has no typed failure channel because producer failures are delivered through
|
|
43
|
+
* `sink.onFailure`; defects and interruption can still affect the run.
|
|
42
44
|
*
|
|
43
45
|
* @example
|
|
44
46
|
* ```ts
|
|
@@ -54,7 +56,7 @@ class Make {
|
|
|
54
56
|
* @param run - A function that takes a `Sink` and returns an `Effect` that drives the stream.
|
|
55
57
|
* @returns An `Fx` instance.
|
|
56
58
|
* @since 1.0.0
|
|
57
|
-
* @category
|
|
59
|
+
* @category Callback sources
|
|
58
60
|
*/
|
|
59
61
|
export const make = (run) => new Make(run);
|
|
60
62
|
/**
|
|
@@ -91,7 +93,7 @@ export const make = (run) => new Make(run);
|
|
|
91
93
|
* It can return a cleanup effect.
|
|
92
94
|
* @returns An `Fx` adapted from the callback.
|
|
93
95
|
* @since 1.0.0
|
|
94
|
-
* @category
|
|
96
|
+
* @category Callback sources
|
|
95
97
|
*/
|
|
96
98
|
export const callback = (run) => make((sink) => Effect.acquireUseRelease(Scope.make(), (scope) => withEarlyExit(sink, Effect.fn(function* (sink) {
|
|
97
99
|
const services = yield* Effect.context();
|
|
@@ -35,7 +35,7 @@ import type { Fx } from "../Fx.js";
|
|
|
35
35
|
* @param period - The duration between emissions.
|
|
36
36
|
* @returns An `Fx` that emits repeatedly.
|
|
37
37
|
* @since 1.0.0
|
|
38
|
-
* @category
|
|
38
|
+
* @category Time and rate
|
|
39
39
|
*/
|
|
40
40
|
export declare const periodic: (period: Duration.Input) => Fx<void>;
|
|
41
41
|
//# sourceMappingURL=periodic.d.ts.map
|
|
@@ -35,7 +35,7 @@ import { fromSchedule } from "./fromSchedule.js";
|
|
|
35
35
|
* @param period - The duration between emissions.
|
|
36
36
|
* @returns An `Fx` that emits repeatedly.
|
|
37
37
|
* @since 1.0.0
|
|
38
|
-
* @category
|
|
38
|
+
* @category Time and rate
|
|
39
39
|
*/
|
|
40
40
|
export const periodic = (period) =>
|
|
41
41
|
/*#__PURE__*/ fromSchedule(spaced(period));
|
|
@@ -23,7 +23,7 @@ import type { Fx } from "../Fx.js";
|
|
|
23
23
|
* @param value - The value to emit.
|
|
24
24
|
* @returns An `Fx` that emits the value.
|
|
25
25
|
* @since 1.0.0
|
|
26
|
-
* @category
|
|
26
|
+
* @category Value sources
|
|
27
27
|
*/
|
|
28
28
|
export declare const succeed: <A>(value: A) => Fx<A>;
|
|
29
29
|
/**
|
|
@@ -47,7 +47,7 @@ export declare const succeed: <A>(value: A) => Fx<A>;
|
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
49
|
* @since 1.0.0
|
|
50
|
-
* @category
|
|
50
|
+
* @category Value sources
|
|
51
51
|
*/
|
|
52
52
|
export declare const succeedNull: Fx<null, never, never>;
|
|
53
53
|
export { succeedNull as null };
|
|
@@ -72,7 +72,7 @@ export { succeedNull as null };
|
|
|
72
72
|
* ```
|
|
73
73
|
*
|
|
74
74
|
* @since 1.0.0
|
|
75
|
-
* @category
|
|
75
|
+
* @category Value sources
|
|
76
76
|
*/
|
|
77
77
|
export declare const succeedUndefined: Fx<undefined, never, never>;
|
|
78
78
|
export { succeedUndefined as undefined };
|
|
@@ -97,7 +97,7 @@ export { succeedUndefined as undefined };
|
|
|
97
97
|
* ```
|
|
98
98
|
*
|
|
99
99
|
* @since 1.0.0
|
|
100
|
-
* @category
|
|
100
|
+
* @category Value sources
|
|
101
101
|
*/
|
|
102
102
|
export declare const succeedVoid: Fx<void, never, never>;
|
|
103
103
|
export { succeedVoid as void };
|
|
@@ -23,7 +23,7 @@ import { make } from "./make.js";
|
|
|
23
23
|
* @param value - The value to emit.
|
|
24
24
|
* @returns An `Fx` that emits the value.
|
|
25
25
|
* @since 1.0.0
|
|
26
|
-
* @category
|
|
26
|
+
* @category Value sources
|
|
27
27
|
*/
|
|
28
28
|
export const succeed = (value) =>
|
|
29
29
|
/*#__PURE__*/ make((sink) => sink.onSuccess(value));
|
|
@@ -48,7 +48,7 @@ export const succeed = (value) =>
|
|
|
48
48
|
* ```
|
|
49
49
|
*
|
|
50
50
|
* @since 1.0.0
|
|
51
|
-
* @category
|
|
51
|
+
* @category Value sources
|
|
52
52
|
*/
|
|
53
53
|
export const succeedNull = succeed(null);
|
|
54
54
|
export { succeedNull as null };
|
|
@@ -73,7 +73,7 @@ export { succeedNull as null };
|
|
|
73
73
|
* ```
|
|
74
74
|
*
|
|
75
75
|
* @since 1.0.0
|
|
76
|
-
* @category
|
|
76
|
+
* @category Value sources
|
|
77
77
|
*/
|
|
78
78
|
export const succeedUndefined = succeed(undefined);
|
|
79
79
|
export { succeedUndefined as undefined };
|
|
@@ -98,7 +98,7 @@ export { succeedUndefined as undefined };
|
|
|
98
98
|
* ```
|
|
99
99
|
*
|
|
100
100
|
* @since 1.0.0
|
|
101
|
-
* @category
|
|
101
|
+
* @category Value sources
|
|
102
102
|
*/
|
|
103
103
|
export const succeedVoid = succeed(void 0);
|
|
104
104
|
export { succeedVoid as void };
|
|
@@ -26,7 +26,7 @@ import type { Fx } from "../Fx.js";
|
|
|
26
26
|
* @param evaluate - The synchronous function evaluated once per run.
|
|
27
27
|
* @returns An Fx that emits the freshly evaluated value.
|
|
28
28
|
* @since 2.0.0
|
|
29
|
-
* @category
|
|
29
|
+
* @category Value sources
|
|
30
30
|
*/
|
|
31
31
|
export declare const sync: <A>(evaluate: () => A) => Fx<A>;
|
|
32
32
|
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -27,6 +27,6 @@ import { fromEffect } from "./fromEffect.js";
|
|
|
27
27
|
* @param evaluate - The synchronous function evaluated once per run.
|
|
28
28
|
* @returns An Fx that emits the freshly evaluated value.
|
|
29
29
|
* @since 2.0.0
|
|
30
|
-
* @category
|
|
30
|
+
* @category Value sources
|
|
31
31
|
*/
|
|
32
32
|
export const sync = (evaluate) => fromEffect(Effect.sync(evaluate));
|
package/dist/Fx/run/collect.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import type { Fx } from "../Fx.js";
|
|
|
30
30
|
* @param fx - The `Fx` to collect values from.
|
|
31
31
|
* @returns An `Effect` that produces an array of all values when the `Fx` completes.
|
|
32
32
|
* @since 1.0.0
|
|
33
|
-
* @category
|
|
33
|
+
* @category Collecting values
|
|
34
34
|
*/
|
|
35
35
|
export declare const collectAll: <A, E = never, R = never>(fx: Fx<A, E, R>) => Effect.Effect<ReadonlyArray<A>, E, R>;
|
|
36
36
|
/**
|
|
@@ -62,7 +62,7 @@ export declare const collectAll: <A, E = never, R = never>(fx: Fx<A, E, R>) => E
|
|
|
62
62
|
* @param fx - The `Fx` to collect values from.
|
|
63
63
|
* @returns An `Effect` that produces a `Fiber` which computes the array of values.
|
|
64
64
|
* @since 1.0.0
|
|
65
|
-
* @category
|
|
65
|
+
* @category Collecting values
|
|
66
66
|
*/
|
|
67
67
|
export declare const collectAllFork: <A, E = never, R = never>(fx: Fx<A, E, R>) => Effect.Effect<Fiber.Fiber<ReadonlyArray<A>, E>, never, R>;
|
|
68
68
|
/**
|
|
@@ -92,7 +92,7 @@ export declare const collectAllFork: <A, E = never, R = never>(fx: Fx<A, E, R>)
|
|
|
92
92
|
* @param upTo - The maximum number of values to collect.
|
|
93
93
|
* @returns An `Effect` that produces an array of up to `n` values.
|
|
94
94
|
* @since 1.0.0
|
|
95
|
-
* @category
|
|
95
|
+
* @category Collecting values
|
|
96
96
|
*/
|
|
97
97
|
export declare const collectUpTo: {
|
|
98
98
|
(upTo: number): <A, E, R>(fx: Fx<A, E, R>) => Effect.Effect<ReadonlyArray<A>, E, R>;
|
|
@@ -128,7 +128,7 @@ export declare const collectUpTo: {
|
|
|
128
128
|
* @param upTo - The maximum number of values to collect.
|
|
129
129
|
* @returns An `Effect` that produces a `Fiber` which computes the array of values.
|
|
130
130
|
* @since 1.0.0
|
|
131
|
-
* @category
|
|
131
|
+
* @category Collecting values
|
|
132
132
|
*/
|
|
133
133
|
export declare const collectUpToFork: <A, E = never, R = never>(fx: Fx<A, E, R>, upTo: number) => Effect.Effect<Fiber.Fiber<ReadonlyArray<A>, E>, never, R>;
|
|
134
134
|
//# sourceMappingURL=collect.d.ts.map
|
package/dist/Fx/run/collect.js
CHANGED
|
@@ -31,7 +31,7 @@ import { observe } from "./observe.js";
|
|
|
31
31
|
* @param fx - The `Fx` to collect values from.
|
|
32
32
|
* @returns An `Effect` that produces an array of all values when the `Fx` completes.
|
|
33
33
|
* @since 1.0.0
|
|
34
|
-
* @category
|
|
34
|
+
* @category Collecting values
|
|
35
35
|
*/
|
|
36
36
|
export const collectAll = (fx) => Effect.suspend(() => {
|
|
37
37
|
const values = [];
|
|
@@ -66,7 +66,7 @@ export const collectAll = (fx) => Effect.suspend(() => {
|
|
|
66
66
|
* @param fx - The `Fx` to collect values from.
|
|
67
67
|
* @returns An `Effect` that produces a `Fiber` which computes the array of values.
|
|
68
68
|
* @since 1.0.0
|
|
69
|
-
* @category
|
|
69
|
+
* @category Collecting values
|
|
70
70
|
*/
|
|
71
71
|
export const collectAllFork = (fx) => Effect.forkChild(collectAll(fx), {
|
|
72
72
|
startImmediately: true,
|
|
@@ -99,7 +99,7 @@ export const collectAllFork = (fx) => Effect.forkChild(collectAll(fx), {
|
|
|
99
99
|
* @param upTo - The maximum number of values to collect.
|
|
100
100
|
* @returns An `Effect` that produces an array of up to `n` values.
|
|
101
101
|
* @since 1.0.0
|
|
102
|
-
* @category
|
|
102
|
+
* @category Collecting values
|
|
103
103
|
*/
|
|
104
104
|
export const collectUpTo = dual(2, (fx, upTo) => fx.pipe(take(upTo), collectAll));
|
|
105
105
|
/**
|
|
@@ -132,7 +132,7 @@ export const collectUpTo = dual(2, (fx, upTo) => fx.pipe(take(upTo), collectAll)
|
|
|
132
132
|
* @param upTo - The maximum number of values to collect.
|
|
133
133
|
* @returns An `Effect` that produces a `Fiber` which computes the array of values.
|
|
134
134
|
* @since 1.0.0
|
|
135
|
-
* @category
|
|
135
|
+
* @category Collecting values
|
|
136
136
|
*/
|
|
137
137
|
export const collectUpToFork = (fx, upTo) => Effect.forkChild(collectUpTo(fx, upTo), {
|
|
138
138
|
startImmediately: true,
|
package/dist/Fx/run/first.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import type { Fx } from "../Fx.js";
|
|
|
30
30
|
* @param fx - The `Fx` stream.
|
|
31
31
|
* @returns An `Effect` that produces `Some(firstValue)` or `None`.
|
|
32
32
|
* @since 1.0.0
|
|
33
|
-
* @category
|
|
33
|
+
* @category Collecting values
|
|
34
34
|
*/
|
|
35
35
|
export declare function first<A, E, R>(fx: Fx<A, E, R>): Effect<Option<A>, E, R>;
|
|
36
36
|
//# sourceMappingURL=first.d.ts.map
|
package/dist/Fx/run/first.js
CHANGED
|
@@ -31,7 +31,7 @@ import { collectUpTo } from "./collect.js";
|
|
|
31
31
|
* @param fx - The `Fx` stream.
|
|
32
32
|
* @returns An `Effect` that produces `Some(firstValue)` or `None`.
|
|
33
33
|
* @since 1.0.0
|
|
34
|
-
* @category
|
|
34
|
+
* @category Collecting values
|
|
35
35
|
*/
|
|
36
36
|
export function first(fx) {
|
|
37
37
|
return pipe(fx, collectUpTo(1), map(head));
|
package/dist/Fx/run/fork.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ import type { Fx } from "../Fx.js";
|
|
|
34
34
|
* @param options - Configuration for the forked fiber.
|
|
35
35
|
* @returns An `Effect` that produces a `Fiber`.
|
|
36
36
|
* @since 1.0.0
|
|
37
|
-
* @category
|
|
37
|
+
* @category Running effects
|
|
38
38
|
*/
|
|
39
39
|
export declare const fork: <A, E, R>(fx: Fx<A, E, R>, options?: {
|
|
40
40
|
readonly startImmediately?: boolean;
|
|
@@ -73,7 +73,7 @@ export declare const fork: <A, E, R>(fx: Fx<A, E, R>, options?: {
|
|
|
73
73
|
* @param options - `RunOptions` for the execution.
|
|
74
74
|
* @returns The created `Fiber`.
|
|
75
75
|
* @since 1.0.0
|
|
76
|
-
* @category
|
|
76
|
+
* @category Running effects
|
|
77
77
|
*/
|
|
78
78
|
export declare const runFork: <A, E>(fx: Fx<A, E>, options?: RunOptions) => Fiber<void, E>;
|
|
79
79
|
//# sourceMappingURL=fork.d.ts.map
|