@typed/fx 1.32.0 → 2.0.0-beta.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 +344 -2
- package/dist/Fx/Fx.d.ts +96 -0
- package/dist/Fx/Fx.d.ts.map +1 -0
- package/dist/Fx/Fx.js +35 -0
- package/dist/Fx/TypeId.d.ts +20 -0
- package/dist/Fx/TypeId.d.ts.map +1 -0
- package/dist/Fx/TypeId.js +15 -0
- package/dist/Fx/combinators/catch.d.ts +53 -0
- package/dist/Fx/combinators/catch.d.ts.map +1 -0
- package/dist/Fx/combinators/catch.js +69 -0
- package/dist/Fx/combinators/causes.d.ts +12 -0
- package/dist/Fx/combinators/causes.d.ts.map +1 -0
- package/dist/Fx/combinators/causes.js +16 -0
- package/dist/Fx/combinators/compact.d.ts +12 -0
- package/dist/Fx/combinators/compact.d.ts.map +1 -0
- package/dist/Fx/combinators/compact.js +11 -0
- package/dist/Fx/combinators/continueWith.d.ts +51 -0
- package/dist/Fx/combinators/continueWith.d.ts.map +1 -0
- package/dist/Fx/combinators/continueWith.js +41 -0
- package/dist/Fx/combinators/ensuring.d.ts +16 -0
- package/dist/Fx/combinators/ensuring.d.ts.map +1 -0
- package/dist/Fx/combinators/ensuring.js +13 -0
- package/dist/Fx/combinators/exhaustLatestMap.d.ts +15 -0
- package/dist/Fx/combinators/exhaustLatestMap.d.ts.map +1 -0
- package/dist/Fx/combinators/exhaustLatestMap.js +48 -0
- package/dist/Fx/combinators/exhaustLatestMapEffect.d.ts +13 -0
- package/dist/Fx/combinators/exhaustLatestMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/exhaustLatestMapEffect.js +14 -0
- package/dist/Fx/combinators/exhaustMap.d.ts +11 -0
- package/dist/Fx/combinators/exhaustMap.d.ts.map +1 -0
- package/dist/Fx/combinators/exhaustMap.js +19 -0
- package/dist/Fx/combinators/exhaustMapEffect.d.ts +11 -0
- package/dist/Fx/combinators/exhaustMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/exhaustMapEffect.js +12 -0
- package/dist/Fx/combinators/exit.d.ts +12 -0
- package/dist/Fx/combinators/exit.d.ts.map +1 -0
- package/dist/Fx/combinators/exit.js +11 -0
- package/dist/Fx/combinators/filter.d.ts +14 -0
- package/dist/Fx/combinators/filter.d.ts.map +1 -0
- package/dist/Fx/combinators/filter.js +12 -0
- package/dist/Fx/combinators/filterEffect.d.ts +15 -0
- package/dist/Fx/combinators/filterEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/filterEffect.js +12 -0
- package/dist/Fx/combinators/filterMap.d.ts +15 -0
- package/dist/Fx/combinators/filterMap.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMap.js +12 -0
- package/dist/Fx/combinators/filterMapEffect.d.ts +16 -0
- package/dist/Fx/combinators/filterMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapEffect.js +12 -0
- package/dist/Fx/combinators/filterMapLoop.d.ts +17 -0
- package/dist/Fx/combinators/filterMapLoop.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapLoop.js +14 -0
- package/dist/Fx/combinators/filterMapLoopCause.d.ts +18 -0
- package/dist/Fx/combinators/filterMapLoopCause.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapLoopCause.js +14 -0
- package/dist/Fx/combinators/filterMapLoopCauseEffect.d.ts +18 -0
- package/dist/Fx/combinators/filterMapLoopCauseEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapLoopCauseEffect.js +13 -0
- package/dist/Fx/combinators/filterMapLoopEffect.d.ts +17 -0
- package/dist/Fx/combinators/filterMapLoopEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/filterMapLoopEffect.js +13 -0
- package/dist/Fx/combinators/flatMap.d.ts +23 -0
- package/dist/Fx/combinators/flatMap.d.ts.map +1 -0
- package/dist/Fx/combinators/flatMap.js +21 -0
- package/dist/Fx/combinators/flatMapConcurrently.d.ts +12 -0
- package/dist/Fx/combinators/flatMapConcurrently.d.ts.map +1 -0
- package/dist/Fx/combinators/flatMapConcurrently.js +22 -0
- package/dist/Fx/combinators/flatMapConcurrentlyEffect.d.ts +12 -0
- package/dist/Fx/combinators/flatMapConcurrentlyEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/flatMapConcurrentlyEffect.js +13 -0
- package/dist/Fx/combinators/flatMapEffect.d.ts +24 -0
- package/dist/Fx/combinators/flatMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/flatMapEffect.js +14 -0
- package/dist/Fx/combinators/flip.d.ts +11 -0
- package/dist/Fx/combinators/flip.d.ts.map +1 -0
- package/dist/Fx/combinators/flip.js +11 -0
- package/dist/Fx/combinators/gen.d.ts +20 -0
- package/dist/Fx/combinators/gen.d.ts.map +1 -0
- package/dist/Fx/combinators/gen.js +14 -0
- package/dist/Fx/combinators/genScoped.d.ts +20 -0
- package/dist/Fx/combinators/genScoped.d.ts.map +1 -0
- package/dist/Fx/combinators/genScoped.js +13 -0
- package/dist/Fx/combinators/index.d.ts +52 -0
- package/dist/Fx/combinators/index.d.ts.map +1 -0
- package/dist/Fx/combinators/index.js +51 -0
- package/dist/Fx/combinators/keyed.d.ts +44 -0
- package/dist/Fx/combinators/keyed.d.ts.map +1 -0
- package/dist/Fx/combinators/keyed.js +199 -0
- package/dist/Fx/combinators/loop.d.ts +16 -0
- package/dist/Fx/combinators/loop.d.ts.map +1 -0
- package/dist/Fx/combinators/loop.js +14 -0
- package/dist/Fx/combinators/loopCause.d.ts +16 -0
- package/dist/Fx/combinators/loopCause.d.ts.map +1 -0
- package/dist/Fx/combinators/loopCause.js +13 -0
- package/dist/Fx/combinators/loopCauseEffect.d.ts +17 -0
- package/dist/Fx/combinators/loopCauseEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/loopCauseEffect.js +13 -0
- package/dist/Fx/combinators/loopEffect.d.ts +16 -0
- package/dist/Fx/combinators/loopEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/loopEffect.js +13 -0
- package/dist/Fx/combinators/map.d.ts +14 -0
- package/dist/Fx/combinators/map.d.ts.map +1 -0
- package/dist/Fx/combinators/map.js +12 -0
- package/dist/Fx/combinators/mapEffect.d.ts +15 -0
- package/dist/Fx/combinators/mapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/mapEffect.js +12 -0
- package/dist/Fx/combinators/mergeAll.d.ts +11 -0
- package/dist/Fx/combinators/mergeAll.d.ts.map +1 -0
- package/dist/Fx/combinators/mergeAll.js +15 -0
- package/dist/Fx/combinators/mergeOrdered.d.ts +14 -0
- package/dist/Fx/combinators/mergeOrdered.d.ts.map +1 -0
- package/dist/Fx/combinators/mergeOrdered.js +89 -0
- package/dist/Fx/combinators/onError.d.ts +17 -0
- package/dist/Fx/combinators/onError.d.ts.map +1 -0
- package/dist/Fx/combinators/onError.js +14 -0
- package/dist/Fx/combinators/onExit.d.ts +16 -0
- package/dist/Fx/combinators/onExit.d.ts.map +1 -0
- package/dist/Fx/combinators/onExit.js +39 -0
- package/dist/Fx/combinators/onInterrupt.d.ts +16 -0
- package/dist/Fx/combinators/onInterrupt.d.ts.map +1 -0
- package/dist/Fx/combinators/onInterrupt.js +38 -0
- package/dist/Fx/combinators/provide.d.ts +23 -0
- package/dist/Fx/combinators/provide.d.ts.map +1 -0
- package/dist/Fx/combinators/provide.js +27 -0
- package/dist/Fx/combinators/skip.d.ts +14 -0
- package/dist/Fx/combinators/skip.d.ts.map +1 -0
- package/dist/Fx/combinators/skip.js +11 -0
- package/dist/Fx/combinators/skipRepeats.d.ts +11 -0
- package/dist/Fx/combinators/skipRepeats.d.ts.map +1 -0
- package/dist/Fx/combinators/skipRepeats.js +12 -0
- package/dist/Fx/combinators/skipRepeatsWith.d.ts +12 -0
- package/dist/Fx/combinators/skipRepeatsWith.d.ts.map +1 -0
- package/dist/Fx/combinators/skipRepeatsWith.js +20 -0
- package/dist/Fx/combinators/slice.d.ts +23 -0
- package/dist/Fx/combinators/slice.d.ts.map +1 -0
- package/dist/Fx/combinators/slice.js +12 -0
- package/dist/Fx/combinators/switchMap.d.ts +13 -0
- package/dist/Fx/combinators/switchMap.d.ts.map +1 -0
- package/dist/Fx/combinators/switchMap.js +33 -0
- package/dist/Fx/combinators/switchMapEffect.d.ts +13 -0
- package/dist/Fx/combinators/switchMapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/switchMapEffect.js +14 -0
- package/dist/Fx/combinators/take.d.ts +14 -0
- package/dist/Fx/combinators/take.d.ts.map +1 -0
- package/dist/Fx/combinators/take.js +11 -0
- package/dist/Fx/combinators/takeUntil.d.ts +28 -0
- package/dist/Fx/combinators/takeUntil.d.ts.map +1 -0
- package/dist/Fx/combinators/takeUntil.js +31 -0
- package/dist/Fx/combinators/tapEffect.d.ts +15 -0
- package/dist/Fx/combinators/tapEffect.d.ts.map +1 -0
- package/dist/Fx/combinators/tapEffect.js +18 -0
- package/dist/Fx/combinators/tuple.d.ts +27 -0
- package/dist/Fx/combinators/tuple.d.ts.map +1 -0
- package/dist/Fx/combinators/tuple.js +46 -0
- package/dist/Fx/combinators/unwrap.d.ts +12 -0
- package/dist/Fx/combinators/unwrap.d.ts.map +1 -0
- package/dist/Fx/combinators/unwrap.js +14 -0
- package/dist/Fx/combinators/unwrapScoped.d.ts +15 -0
- package/dist/Fx/combinators/unwrapScoped.d.ts.map +1 -0
- package/dist/Fx/combinators/unwrapScoped.js +16 -0
- package/dist/Fx/combinators/when.d.ts +36 -0
- package/dist/Fx/combinators/when.d.ts.map +1 -0
- package/dist/Fx/combinators/when.js +28 -0
- package/dist/Fx/combinators/withSpan.d.ts +4 -0
- package/dist/Fx/combinators/withSpan.d.ts.map +1 -0
- package/dist/Fx/combinators/withSpan.js +6 -0
- package/dist/Fx/constructors/at.d.ts +16 -0
- package/dist/Fx/constructors/at.d.ts.map +1 -0
- package/dist/Fx/constructors/at.js +13 -0
- package/dist/Fx/constructors/die.d.ts +11 -0
- package/dist/Fx/constructors/die.d.ts.map +1 -0
- package/dist/Fx/constructors/die.js +12 -0
- package/dist/Fx/constructors/empty.d.ts +8 -0
- package/dist/Fx/constructors/empty.d.ts.map +1 -0
- package/dist/Fx/constructors/empty.js +8 -0
- package/dist/Fx/constructors/fail.d.ts +11 -0
- package/dist/Fx/constructors/fail.d.ts.map +1 -0
- package/dist/Fx/constructors/fail.js +12 -0
- package/dist/Fx/constructors/failCause.d.ts +12 -0
- package/dist/Fx/constructors/failCause.d.ts.map +1 -0
- package/dist/Fx/constructors/failCause.js +11 -0
- package/dist/Fx/constructors/fn.d.ts +47 -0
- package/dist/Fx/constructors/fn.d.ts.map +1 -0
- package/dist/Fx/constructors/fn.js +23 -0
- package/dist/Fx/constructors/fromEffect.d.ts +21 -0
- package/dist/Fx/constructors/fromEffect.d.ts.map +1 -0
- package/dist/Fx/constructors/fromEffect.js +21 -0
- package/dist/Fx/constructors/fromFailures.d.ts +10 -0
- package/dist/Fx/constructors/fromFailures.d.ts.map +1 -0
- package/dist/Fx/constructors/fromFailures.js +13 -0
- package/dist/Fx/constructors/fromIterable.d.ts +12 -0
- package/dist/Fx/constructors/fromIterable.d.ts.map +1 -0
- package/dist/Fx/constructors/fromIterable.js +12 -0
- package/dist/Fx/constructors/fromSchedule.d.ts +13 -0
- package/dist/Fx/constructors/fromSchedule.d.ts.map +1 -0
- package/dist/Fx/constructors/fromSchedule.js +13 -0
- package/dist/Fx/constructors/fromYieldable.d.ts +12 -0
- package/dist/Fx/constructors/fromYieldable.d.ts.map +1 -0
- package/dist/Fx/constructors/fromYieldable.js +12 -0
- package/dist/Fx/constructors/index.d.ts +16 -0
- package/dist/Fx/constructors/index.d.ts.map +1 -0
- package/dist/Fx/constructors/index.js +15 -0
- package/dist/Fx/constructors/interrupt.d.ts +10 -0
- package/dist/Fx/constructors/interrupt.d.ts.map +1 -0
- package/dist/Fx/constructors/interrupt.js +12 -0
- package/dist/Fx/constructors/make.d.ts +40 -0
- package/dist/Fx/constructors/make.d.ts.map +1 -0
- package/dist/Fx/constructors/make.js +61 -0
- package/dist/Fx/constructors/periodic.d.ts +12 -0
- package/dist/Fx/constructors/periodic.d.ts.map +1 -0
- package/dist/Fx/constructors/periodic.js +12 -0
- package/dist/Fx/constructors/succeed.d.ts +32 -0
- package/dist/Fx/constructors/succeed.d.ts.map +1 -0
- package/dist/Fx/constructors/succeed.js +32 -0
- package/dist/Fx/constructors/suspend.d.ts +3 -0
- package/dist/Fx/constructors/suspend.d.ts.map +1 -0
- package/dist/Fx/constructors/suspend.js +3 -0
- package/dist/Fx/index.d.ts +7 -0
- package/dist/Fx/index.d.ts.map +1 -0
- package/dist/Fx/index.js +6 -0
- package/dist/Fx/internal/DeferredRef.d.ts +29 -0
- package/dist/Fx/internal/DeferredRef.d.ts.map +1 -0
- package/dist/{esm → Fx}/internal/DeferredRef.js +21 -15
- package/dist/Fx/internal/UnionToTuple.d.ts.map +1 -0
- package/dist/Fx/internal/UnionToTuple.js +1 -0
- package/dist/{dts → Fx}/internal/diff.d.ts +3 -1
- package/dist/Fx/internal/diff.d.ts.map +1 -0
- package/dist/{esm → Fx}/internal/diff.js +37 -23
- package/dist/Fx/internal/equivalence.d.ts +4 -0
- package/dist/Fx/internal/equivalence.d.ts.map +1 -0
- package/dist/Fx/internal/equivalence.js +10 -0
- package/dist/Fx/internal/multicast.d.ts +10 -0
- package/dist/Fx/internal/multicast.d.ts.map +1 -0
- package/dist/Fx/internal/multicast.js +32 -0
- package/dist/Fx/internal/ring-buffer.d.ts +14 -0
- package/dist/Fx/internal/ring-buffer.d.ts.map +1 -0
- package/dist/Fx/internal/ring-buffer.js +52 -0
- package/dist/Fx/internal/scope.d.ts +11 -0
- package/dist/Fx/internal/scope.d.ts.map +1 -0
- package/dist/Fx/internal/scope.js +12 -0
- package/dist/Fx/internal/yieldable.d.ts +17 -0
- package/dist/Fx/internal/yieldable.d.ts.map +1 -0
- package/dist/Fx/internal/yieldable.js +20 -0
- package/dist/Fx/run/collect.d.ts +45 -0
- package/dist/Fx/run/collect.d.ts.map +1 -0
- package/dist/Fx/run/collect.js +51 -0
- package/dist/Fx/run/first.d.ts +14 -0
- package/dist/Fx/run/first.d.ts.map +1 -0
- package/dist/Fx/run/first.js +16 -0
- package/dist/Fx/run/fork.d.ts +29 -0
- package/dist/Fx/run/fork.d.ts.map +1 -0
- package/dist/Fx/run/fork.js +27 -0
- package/dist/Fx/run/index.d.ts +6 -0
- package/dist/Fx/run/index.d.ts.map +1 -0
- package/dist/Fx/run/index.js +5 -0
- package/dist/Fx/run/observe.d.ts +53 -0
- package/dist/Fx/run/observe.d.ts.map +1 -0
- package/dist/Fx/run/observe.js +55 -0
- package/dist/Fx/run/runPromise.d.ts +25 -0
- package/dist/Fx/run/runPromise.d.ts.map +1 -0
- package/dist/Fx/run/runPromise.js +23 -0
- package/dist/Fx/stream.d.ts +7 -0
- package/dist/Fx/stream.d.ts.map +1 -0
- package/dist/Fx/stream.js +7 -0
- package/dist/Fx.d.ts +2 -0
- package/dist/Fx.d.ts.map +1 -0
- package/dist/Fx.js +1 -0
- package/dist/Push/Push.d.ts +312 -0
- package/dist/Push/Push.d.ts.map +1 -0
- package/dist/Push/Push.js +289 -0
- package/dist/Push/index.d.ts +2 -0
- package/dist/Push/index.d.ts.map +1 -0
- package/dist/Push/index.js +1 -0
- package/dist/Push.d.ts +2 -0
- package/dist/Push.d.ts.map +1 -0
- package/dist/Push.js +1 -0
- package/dist/{dts → RefSubject}/RefArray.d.ts +68 -18
- package/dist/RefSubject/RefArray.d.ts.map +1 -0
- package/dist/{esm → RefSubject}/RefArray.js +80 -12
- package/dist/RefSubject/RefBigDecimal.d.ts +183 -0
- package/dist/RefSubject/RefBigDecimal.d.ts.map +1 -0
- package/dist/RefSubject/RefBigDecimal.js +161 -0
- package/dist/RefSubject/RefBigInt.d.ts +138 -0
- package/dist/RefSubject/RefBigInt.d.ts.map +1 -0
- package/dist/RefSubject/RefBigInt.js +126 -0
- package/dist/RefSubject/RefBoolean.d.ts +135 -0
- package/dist/RefSubject/RefBoolean.d.ts.map +1 -0
- package/dist/RefSubject/RefBoolean.js +124 -0
- package/dist/RefSubject/RefCause.d.ts +100 -0
- package/dist/RefSubject/RefCause.d.ts.map +1 -0
- package/dist/RefSubject/RefCause.js +93 -0
- package/dist/{dts → RefSubject}/RefChunk.d.ts +157 -71
- package/dist/RefSubject/RefChunk.d.ts.map +1 -0
- package/dist/{esm → RefSubject}/RefChunk.js +142 -52
- package/dist/RefSubject/RefDateTime.d.ts +155 -0
- package/dist/RefSubject/RefDateTime.d.ts.map +1 -0
- package/dist/RefSubject/RefDateTime.js +101 -0
- package/dist/RefSubject/RefDuration.d.ts +126 -0
- package/dist/RefSubject/RefDuration.d.ts.map +1 -0
- package/dist/RefSubject/RefDuration.js +115 -0
- package/dist/RefSubject/RefGraph.d.ts +239 -0
- package/dist/RefSubject/RefGraph.d.ts.map +1 -0
- package/dist/RefSubject/RefGraph.js +272 -0
- package/dist/RefSubject/RefHashMap.d.ts +228 -0
- package/dist/RefSubject/RefHashMap.d.ts.map +1 -0
- package/dist/RefSubject/RefHashMap.js +212 -0
- package/dist/RefSubject/RefHashRing.d.ts +123 -0
- package/dist/RefSubject/RefHashRing.d.ts.map +1 -0
- package/dist/RefSubject/RefHashRing.js +115 -0
- package/dist/RefSubject/RefHashSet.d.ts +179 -0
- package/dist/RefSubject/RefHashSet.d.ts.map +1 -0
- package/dist/RefSubject/RefHashSet.js +164 -0
- package/dist/RefSubject/RefIterable.d.ts +257 -0
- package/dist/RefSubject/RefIterable.d.ts.map +1 -0
- package/dist/RefSubject/RefIterable.js +237 -0
- package/dist/RefSubject/RefOption.d.ts +124 -0
- package/dist/RefSubject/RefOption.d.ts.map +1 -0
- package/dist/RefSubject/RefOption.js +115 -0
- package/dist/RefSubject/RefRecord.d.ts +264 -0
- package/dist/RefSubject/RefRecord.d.ts.map +1 -0
- package/dist/RefSubject/RefRecord.js +249 -0
- package/dist/RefSubject/RefResult.d.ts +121 -0
- package/dist/RefSubject/RefResult.d.ts.map +1 -0
- package/dist/RefSubject/RefResult.js +107 -0
- package/dist/RefSubject/RefString.d.ts +147 -0
- package/dist/RefSubject/RefString.d.ts.map +1 -0
- package/dist/RefSubject/RefString.js +137 -0
- package/dist/RefSubject/RefStruct.d.ts +123 -0
- package/dist/RefSubject/RefStruct.d.ts.map +1 -0
- package/dist/RefSubject/RefStruct.js +113 -0
- package/dist/RefSubject/RefSubject.d.ts +1010 -0
- package/dist/RefSubject/RefSubject.d.ts.map +1 -0
- package/dist/RefSubject/RefSubject.js +1310 -0
- package/dist/RefSubject/RefTrie.d.ts +216 -0
- package/dist/RefSubject/RefTrie.d.ts.map +1 -0
- package/dist/RefSubject/RefTrie.js +201 -0
- package/dist/RefSubject/RefTuple.d.ts +107 -0
- package/dist/RefSubject/RefTuple.d.ts.map +1 -0
- package/dist/RefSubject/RefTuple.js +94 -0
- package/dist/RefSubject/index.d.ts +22 -0
- package/dist/RefSubject/index.d.ts.map +1 -0
- package/dist/RefSubject/index.js +21 -0
- package/dist/RefSubject.d.ts +2 -0
- package/dist/RefSubject.d.ts.map +1 -0
- package/dist/RefSubject.js +1 -0
- package/dist/Sink/Sink.d.ts +94 -0
- package/dist/Sink/Sink.d.ts.map +1 -0
- package/dist/Sink/Sink.js +34 -0
- package/dist/Sink/combinators.d.ts +171 -0
- package/dist/Sink/combinators.d.ts.map +1 -0
- package/dist/{esm/Sink.js → Sink/combinators.js} +265 -352
- package/dist/Sink/index.d.ts +3 -0
- package/dist/Sink/index.d.ts.map +1 -0
- package/dist/Sink/index.js +2 -0
- package/dist/Sink.d.ts +2 -0
- package/dist/Sink.d.ts.map +1 -0
- package/dist/Sink.js +1 -0
- package/dist/Subject/Subject.d.ts +152 -0
- package/dist/Subject/Subject.d.ts.map +1 -0
- package/dist/Subject/Subject.js +272 -0
- package/dist/Subject/index.d.ts +2 -0
- package/dist/Subject/index.d.ts.map +1 -0
- package/dist/Subject/index.js +1 -0
- package/dist/Subject.d.ts +2 -0
- package/dist/Subject.d.ts.map +1 -0
- package/dist/Subject.js +1 -0
- package/dist/Versioned/Versioned.d.ts +176 -0
- package/dist/Versioned/Versioned.d.ts.map +1 -0
- package/dist/Versioned/Versioned.js +228 -0
- package/dist/Versioned/index.d.ts +2 -0
- package/dist/Versioned/index.d.ts.map +1 -0
- package/dist/Versioned/index.js +1 -0
- package/dist/Versioned.d.ts +2 -0
- package/dist/Versioned.d.ts.map +1 -0
- package/dist/Versioned.js +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/package.json +19 -192
- package/src/Fx/Fx.ts +164 -0
- package/src/Fx/TypeId.ts +25 -0
- package/src/Fx/combinators/catch.ts +165 -0
- package/src/Fx/combinators/causes.ts +23 -0
- package/src/Fx/combinators/compact.ts +15 -0
- package/src/Fx/combinators/continueWith.ts +78 -0
- package/src/Fx/combinators/ensuring.ts +23 -0
- package/src/Fx/combinators/exhaustLatestMap.ts +74 -0
- package/src/Fx/combinators/exhaustLatestMapEffect.ts +25 -0
- package/src/Fx/combinators/exhaustMap.ts +36 -0
- package/src/Fx/combinators/exhaustMapEffect.ts +23 -0
- package/src/Fx/combinators/exit.ts +15 -0
- package/src/Fx/combinators/filter.ts +22 -0
- package/src/Fx/combinators/filterEffect.ts +31 -0
- package/src/Fx/combinators/filterMap.ts +23 -0
- package/src/Fx/combinators/filterMapEffect.ts +32 -0
- package/src/Fx/combinators/filterMapLoop.ts +35 -0
- package/src/Fx/combinators/filterMapLoopCause.ts +36 -0
- package/src/Fx/combinators/filterMapLoopCauseEffect.ts +46 -0
- package/src/Fx/combinators/filterMapLoopEffect.ts +36 -0
- package/src/Fx/combinators/flatMap.ts +51 -0
- package/src/Fx/combinators/flatMapConcurrently.ts +36 -0
- package/src/Fx/combinators/flatMapConcurrentlyEffect.ts +26 -0
- package/src/Fx/combinators/flatMapEffect.ts +42 -0
- package/src/Fx/combinators/flip.ts +14 -0
- package/src/Fx/combinators/gen.ts +24 -0
- package/src/Fx/combinators/genScoped.ts +24 -0
- package/src/Fx/combinators/index.ts +51 -0
- package/src/Fx/combinators/keyed.ts +369 -0
- package/src/Fx/combinators/loop.ts +27 -0
- package/src/Fx/combinators/loopCause.ts +34 -0
- package/src/Fx/combinators/loopCauseEffect.ts +36 -0
- package/src/Fx/combinators/loopEffect.ts +34 -0
- package/src/Fx/combinators/map.ts +22 -0
- package/src/Fx/combinators/mapEffect.ts +32 -0
- package/src/Fx/combinators/mergeAll.ts +22 -0
- package/src/Fx/combinators/mergeOrdered.ts +123 -0
- package/src/Fx/combinators/onError.ts +40 -0
- package/src/Fx/combinators/onExit.ts +82 -0
- package/src/Fx/combinators/onInterrupt.ts +87 -0
- package/src/Fx/combinators/provide.ts +62 -0
- package/src/Fx/combinators/skip.ts +20 -0
- package/src/Fx/combinators/skipRepeats.ts +15 -0
- package/src/Fx/combinators/skipRepeatsWith.ts +40 -0
- package/src/Fx/combinators/slice.ts +32 -0
- package/src/Fx/combinators/switchMap.ts +55 -0
- package/src/Fx/combinators/switchMapEffect.ts +25 -0
- package/src/Fx/combinators/take.ts +17 -0
- package/src/Fx/combinators/takeUntil.ts +50 -0
- package/src/Fx/combinators/tapEffect.ts +39 -0
- package/src/Fx/combinators/tuple.ts +79 -0
- package/src/Fx/combinators/unwrap.ts +21 -0
- package/src/Fx/combinators/unwrapScoped.ts +26 -0
- package/src/Fx/combinators/when.ts +64 -0
- package/src/Fx/combinators/withSpan.ts +24 -0
- package/src/Fx/constructors/at.ts +23 -0
- package/src/Fx/constructors/die.ts +17 -0
- package/src/Fx/constructors/empty.ts +10 -0
- package/src/Fx/constructors/fail.ts +14 -0
- package/src/Fx/constructors/failCause.ts +14 -0
- package/src/Fx/constructors/fn.ts +245 -0
- package/src/Fx/constructors/fromEffect.ts +24 -0
- package/src/Fx/constructors/fromFailures.ts +19 -0
- package/src/Fx/constructors/fromIterable.ts +15 -0
- package/src/Fx/constructors/fromSchedule.ts +18 -0
- package/src/Fx/constructors/fromYieldable.ts +17 -0
- package/src/Fx/constructors/index.ts +15 -0
- package/src/Fx/constructors/interrupt.ts +13 -0
- package/src/Fx/constructors/make.ts +103 -0
- package/src/Fx/constructors/periodic.ts +15 -0
- package/src/Fx/constructors/succeed.ts +37 -0
- package/src/Fx/constructors/suspend.ts +6 -0
- package/src/Fx/index.ts +6 -0
- package/src/Fx/internal/DeferredRef.ts +87 -0
- package/src/Fx/internal/UnionToTuple.ts +12 -0
- package/src/Fx/internal/diff.ts +191 -0
- package/src/Fx/internal/equivalence.ts +12 -0
- package/src/Fx/internal/multicast.ts +51 -0
- package/src/Fx/internal/ring-buffer.ts +60 -0
- package/src/Fx/internal/scope.ts +58 -0
- package/src/Fx/internal/yieldable.ts +31 -0
- package/src/Fx/run/collect.ts +79 -0
- package/src/Fx/run/first.ts +20 -0
- package/src/Fx/run/fork.ts +40 -0
- package/src/Fx/run/index.ts +5 -0
- package/src/Fx/run/observe.ts +114 -0
- package/src/Fx/run/runPromise.ts +32 -0
- package/src/Fx/stream.ts +42 -0
- package/src/Fx.catch.test.ts +61 -0
- package/src/Fx.fn.test.ts +51 -0
- package/src/Fx.lifecycle.test.ts +80 -0
- package/src/Fx.test.ts +71 -0
- package/src/Fx.ts +1 -2591
- package/src/Push/Push.ts +903 -0
- package/src/Push/index.ts +1 -0
- package/src/Push.test.ts +26 -0
- package/src/Push.ts +1 -480
- package/src/{RefArray.ts → RefSubject/RefArray.ts} +246 -248
- package/src/RefSubject/RefBigDecimal.test.ts +56 -0
- package/src/RefSubject/RefBigDecimal.ts +295 -0
- package/src/RefSubject/RefBigInt.test.ts +56 -0
- package/src/RefSubject/RefBigInt.ts +189 -0
- package/src/RefSubject/RefBoolean.test.ts +57 -0
- package/src/RefSubject/RefBoolean.ts +185 -0
- package/src/RefSubject/RefCause.test.ts +53 -0
- package/src/RefSubject/RefCause.ts +146 -0
- package/src/RefSubject/RefChunk.ts +510 -0
- package/src/RefSubject/RefDateTime.test.ts +43 -0
- package/src/RefSubject/RefDateTime.ts +264 -0
- package/src/RefSubject/RefDuration.test.ts +49 -0
- package/src/RefSubject/RefDuration.ts +188 -0
- package/src/RefSubject/RefGraph.ts +650 -0
- package/src/RefSubject/RefHashMap.ts +465 -0
- package/src/RefSubject/RefHashRing.ts +262 -0
- package/src/RefSubject/RefHashSet.ts +308 -0
- package/src/RefSubject/RefIterable.ts +445 -0
- package/src/RefSubject/RefOption.test.ts +67 -0
- package/src/RefSubject/RefOption.ts +193 -0
- package/src/RefSubject/RefRecord.ts +612 -0
- package/src/RefSubject/RefResult.test.ts +63 -0
- package/src/RefSubject/RefResult.ts +209 -0
- package/src/RefSubject/RefString.test.ts +61 -0
- package/src/RefSubject/RefString.ts +256 -0
- package/src/RefSubject/RefStruct.test.ts +60 -0
- package/src/RefSubject/RefStruct.ts +253 -0
- package/src/RefSubject/RefSubject.ts +2545 -0
- package/src/RefSubject/RefTrie.ts +356 -0
- package/src/RefSubject/RefTuple.test.ts +60 -0
- package/src/RefSubject/RefTuple.ts +231 -0
- package/src/RefSubject/index.ts +21 -0
- package/src/RefSubject.test.ts +65 -0
- package/src/RefSubject.ts +1 -2488
- package/src/Sink/Sink.ts +159 -0
- package/src/Sink/combinators.ts +993 -0
- package/src/Sink/index.ts +2 -0
- package/src/Sink.ts +1 -1044
- package/src/Subject/Subject.ts +441 -0
- package/src/Subject/index.ts +1 -0
- package/src/Subject.test.ts +47 -0
- package/src/Subject.ts +1 -330
- package/src/Versioned/Versioned.ts +521 -0
- package/src/Versioned/index.ts +1 -0
- package/src/Versioned.test.ts +23 -0
- package/src/Versioned.ts +1 -357
- package/src/index.ts +7 -130
- package/tsconfig.json +6 -0
- package/AsyncData/package.json +0 -6
- package/Emitter/package.json +0 -6
- package/Form/package.json +0 -6
- package/FormEntry/package.json +0 -6
- package/Fx/package.json +0 -6
- package/Idle/package.json +0 -6
- package/LICENSE +0 -21
- package/Match/package.json +0 -6
- package/Pull/package.json +0 -6
- package/Push/package.json +0 -6
- package/RefArray/package.json +0 -6
- package/RefChunk/package.json +0 -6
- package/RefHashMap/package.json +0 -6
- package/RefHashSet/package.json +0 -6
- package/RefSubject/package.json +0 -6
- package/Sink/package.json +0 -6
- package/Stream/package.json +0 -6
- package/Subject/package.json +0 -6
- package/TypeId/package.json +0 -6
- package/Typeclass/package.json +0 -6
- package/Versioned/package.json +0 -6
- package/dist/cjs/AsyncData.js +0 -188
- package/dist/cjs/AsyncData.js.map +0 -1
- package/dist/cjs/Emitter.js +0 -44
- package/dist/cjs/Emitter.js.map +0 -1
- package/dist/cjs/Form.js +0 -178
- package/dist/cjs/Form.js.map +0 -1
- package/dist/cjs/FormEntry.js +0 -110
- package/dist/cjs/FormEntry.js.map +0 -1
- package/dist/cjs/Fx.js +0 -998
- package/dist/cjs/Fx.js.map +0 -1
- package/dist/cjs/Idle.js +0 -190
- package/dist/cjs/Idle.js.map +0 -1
- package/dist/cjs/Match.js +0 -191
- package/dist/cjs/Match.js.map +0 -1
- package/dist/cjs/Pull.js +0 -52
- package/dist/cjs/Pull.js.map +0 -1
- package/dist/cjs/Push.js +0 -168
- package/dist/cjs/Push.js.map +0 -1
- package/dist/cjs/RefArray.js +0 -253
- package/dist/cjs/RefArray.js.map +0 -1
- package/dist/cjs/RefChunk.js +0 -212
- package/dist/cjs/RefChunk.js.map +0 -1
- package/dist/cjs/RefHashMap.js +0 -198
- package/dist/cjs/RefHashMap.js.map +0 -1
- package/dist/cjs/RefHashSet.js +0 -99
- package/dist/cjs/RefHashSet.js.map +0 -1
- package/dist/cjs/RefSubject.js +0 -1115
- package/dist/cjs/RefSubject.js.map +0 -1
- package/dist/cjs/Sink.js +0 -662
- package/dist/cjs/Sink.js.map +0 -1
- package/dist/cjs/Stream.js +0 -87
- package/dist/cjs/Stream.js.map +0 -1
- package/dist/cjs/Subject.js +0 -205
- package/dist/cjs/Subject.js.map +0 -1
- package/dist/cjs/TypeId.js +0 -32
- package/dist/cjs/TypeId.js.map +0 -1
- package/dist/cjs/Typeclass.js +0 -380
- package/dist/cjs/Typeclass.js.map +0 -1
- package/dist/cjs/Versioned.js +0 -172
- package/dist/cjs/Versioned.js.map +0 -1
- package/dist/cjs/index.js +0 -89
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/internal/DeferredRef.js +0 -67
- package/dist/cjs/internal/DeferredRef.js.map +0 -1
- package/dist/cjs/internal/UnionToTuple.js +0 -6
- package/dist/cjs/internal/UnionToTuple.js.map +0 -1
- package/dist/cjs/internal/bounds.js +0 -26
- package/dist/cjs/internal/bounds.js.map +0 -1
- package/dist/cjs/internal/core.js +0 -1783
- package/dist/cjs/internal/core.js.map +0 -1
- package/dist/cjs/internal/diff.js +0 -122
- package/dist/cjs/internal/diff.js.map +0 -1
- package/dist/cjs/internal/effect-loop-operator.js +0 -288
- package/dist/cjs/internal/effect-loop-operator.js.map +0 -1
- package/dist/cjs/internal/effect-operator.js +0 -156
- package/dist/cjs/internal/effect-operator.js.map +0 -1
- package/dist/cjs/internal/effect-producer.js +0 -74
- package/dist/cjs/internal/effect-producer.js.map +0 -1
- package/dist/cjs/internal/helpers.js +0 -317
- package/dist/cjs/internal/helpers.js.map +0 -1
- package/dist/cjs/internal/keyed.js +0 -168
- package/dist/cjs/internal/keyed.js.map +0 -1
- package/dist/cjs/internal/loop-operator.js +0 -213
- package/dist/cjs/internal/loop-operator.js.map +0 -1
- package/dist/cjs/internal/operator.js +0 -79
- package/dist/cjs/internal/operator.js.map +0 -1
- package/dist/cjs/internal/protos.js +0 -48
- package/dist/cjs/internal/protos.js.map +0 -1
- package/dist/cjs/internal/provide.js +0 -100
- package/dist/cjs/internal/provide.js.map +0 -1
- package/dist/cjs/internal/requestIdleCallback.js +0 -22
- package/dist/cjs/internal/requestIdleCallback.js.map +0 -1
- package/dist/cjs/internal/share.js +0 -74
- package/dist/cjs/internal/share.js.map +0 -1
- package/dist/cjs/internal/strategies.js +0 -34
- package/dist/cjs/internal/strategies.js.map +0 -1
- package/dist/cjs/internal/sync-operator.js +0 -120
- package/dist/cjs/internal/sync-operator.js.map +0 -1
- package/dist/cjs/internal/sync-producer.js +0 -118
- package/dist/cjs/internal/sync-producer.js.map +0 -1
- package/dist/cjs/internal/withKey.js +0 -63
- package/dist/cjs/internal/withKey.js.map +0 -1
- package/dist/dts/AsyncData.d.ts +0 -179
- package/dist/dts/AsyncData.d.ts.map +0 -1
- package/dist/dts/Emitter.d.ts +0 -24
- package/dist/dts/Emitter.d.ts.map +0 -1
- package/dist/dts/Form.d.ts +0 -145
- package/dist/dts/Form.d.ts.map +0 -1
- package/dist/dts/FormEntry.d.ts +0 -65
- package/dist/dts/FormEntry.d.ts.map +0 -1
- package/dist/dts/Fx.d.ts +0 -1678
- package/dist/dts/Fx.d.ts.map +0 -1
- package/dist/dts/Idle.d.ts +0 -84
- package/dist/dts/Idle.d.ts.map +0 -1
- package/dist/dts/Match.d.ts +0 -60
- package/dist/dts/Match.d.ts.map +0 -1
- package/dist/dts/Pull.d.ts +0 -37
- package/dist/dts/Pull.d.ts.map +0 -1
- package/dist/dts/Push.d.ts +0 -176
- package/dist/dts/Push.d.ts.map +0 -1
- package/dist/dts/RefArray.d.ts.map +0 -1
- package/dist/dts/RefChunk.d.ts.map +0 -1
- package/dist/dts/RefHashMap.d.ts +0 -189
- package/dist/dts/RefHashMap.d.ts.map +0 -1
- package/dist/dts/RefHashSet.d.ts +0 -100
- package/dist/dts/RefHashSet.d.ts.map +0 -1
- package/dist/dts/RefSubject.d.ts +0 -601
- package/dist/dts/RefSubject.d.ts.map +0 -1
- package/dist/dts/Sink.d.ts +0 -252
- package/dist/dts/Sink.d.ts.map +0 -1
- package/dist/dts/Stream.d.ts +0 -66
- package/dist/dts/Stream.d.ts.map +0 -1
- package/dist/dts/Subject.d.ts +0 -61
- package/dist/dts/Subject.d.ts.map +0 -1
- package/dist/dts/TypeId.d.ts +0 -51
- package/dist/dts/TypeId.d.ts.map +0 -1
- package/dist/dts/Typeclass.d.ts +0 -284
- package/dist/dts/Typeclass.d.ts.map +0 -1
- package/dist/dts/Versioned.d.ts +0 -117
- package/dist/dts/Versioned.d.ts.map +0 -1
- package/dist/dts/index.d.ts +0 -111
- package/dist/dts/index.d.ts.map +0 -1
- package/dist/dts/internal/DeferredRef.d.ts +0 -22
- package/dist/dts/internal/DeferredRef.d.ts.map +0 -1
- package/dist/dts/internal/UnionToTuple.d.ts.map +0 -1
- package/dist/dts/internal/bounds.d.ts +0 -9
- package/dist/dts/internal/bounds.d.ts.map +0 -1
- package/dist/dts/internal/core.d.ts +0 -237
- package/dist/dts/internal/core.d.ts.map +0 -1
- package/dist/dts/internal/diff.d.ts.map +0 -1
- package/dist/dts/internal/effect-loop-operator.d.ts +0 -34
- package/dist/dts/internal/effect-loop-operator.d.ts.map +0 -1
- package/dist/dts/internal/effect-operator.d.ts +0 -40
- package/dist/dts/internal/effect-operator.d.ts.map +0 -1
- package/dist/dts/internal/effect-producer.d.ts +0 -25
- package/dist/dts/internal/effect-producer.d.ts.map +0 -1
- package/dist/dts/internal/helpers.d.ts +0 -60
- package/dist/dts/internal/helpers.d.ts.map +0 -1
- package/dist/dts/internal/keyed.d.ts +0 -4
- package/dist/dts/internal/keyed.d.ts.map +0 -1
- package/dist/dts/internal/loop-operator.d.ts +0 -40
- package/dist/dts/internal/loop-operator.d.ts.map +0 -1
- package/dist/dts/internal/operator.d.ts +0 -16
- package/dist/dts/internal/operator.d.ts.map +0 -1
- package/dist/dts/internal/protos.d.ts +0 -23
- package/dist/dts/internal/protos.d.ts.map +0 -1
- package/dist/dts/internal/provide.d.ts +0 -46
- package/dist/dts/internal/provide.d.ts.map +0 -1
- package/dist/dts/internal/requestIdleCallback.d.ts +0 -3
- package/dist/dts/internal/requestIdleCallback.d.ts.map +0 -1
- package/dist/dts/internal/share.d.ts +0 -33
- package/dist/dts/internal/share.d.ts.map +0 -1
- package/dist/dts/internal/strategies.d.ts +0 -9
- package/dist/dts/internal/strategies.d.ts.map +0 -1
- package/dist/dts/internal/sync-operator.d.ts +0 -32
- package/dist/dts/internal/sync-operator.d.ts.map +0 -1
- package/dist/dts/internal/sync-producer.d.ts +0 -36
- package/dist/dts/internal/sync-producer.d.ts.map +0 -1
- package/dist/dts/internal/withKey.d.ts +0 -4
- package/dist/dts/internal/withKey.d.ts.map +0 -1
- package/dist/esm/AsyncData.js +0 -156
- package/dist/esm/AsyncData.js.map +0 -1
- package/dist/esm/Emitter.js +0 -33
- package/dist/esm/Emitter.js.map +0 -1
- package/dist/esm/Form.js +0 -163
- package/dist/esm/Form.js.map +0 -1
- package/dist/esm/FormEntry.js +0 -100
- package/dist/esm/FormEntry.js.map +0 -1
- package/dist/esm/Fx.js +0 -984
- package/dist/esm/Fx.js.map +0 -1
- package/dist/esm/Idle.js +0 -178
- package/dist/esm/Idle.js.map +0 -1
- package/dist/esm/Match.js +0 -185
- package/dist/esm/Match.js.map +0 -1
- package/dist/esm/Pull.js +0 -41
- package/dist/esm/Pull.js.map +0 -1
- package/dist/esm/Push.js +0 -159
- package/dist/esm/Push.js.map +0 -1
- package/dist/esm/RefArray.js.map +0 -1
- package/dist/esm/RefChunk.js.map +0 -1
- package/dist/esm/RefHashMap.js +0 -176
- package/dist/esm/RefHashMap.js.map +0 -1
- package/dist/esm/RefHashSet.js +0 -86
- package/dist/esm/RefHashSet.js.map +0 -1
- package/dist/esm/RefSubject.js +0 -1076
- package/dist/esm/RefSubject.js.map +0 -1
- package/dist/esm/Sink.js.map +0 -1
- package/dist/esm/Stream.js +0 -76
- package/dist/esm/Stream.js.map +0 -1
- package/dist/esm/Subject.js +0 -198
- package/dist/esm/Subject.js.map +0 -1
- package/dist/esm/TypeId.js +0 -26
- package/dist/esm/TypeId.js.map +0 -1
- package/dist/esm/Typeclass.js +0 -375
- package/dist/esm/Typeclass.js.map +0 -1
- package/dist/esm/Versioned.js +0 -149
- package/dist/esm/Versioned.js.map +0 -1
- package/dist/esm/index.js +0 -111
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/internal/DeferredRef.js.map +0 -1
- package/dist/esm/internal/UnionToTuple.js +0 -2
- package/dist/esm/internal/UnionToTuple.js.map +0 -1
- package/dist/esm/internal/bounds.js +0 -13
- package/dist/esm/internal/bounds.js.map +0 -1
- package/dist/esm/internal/core.js +0 -1647
- package/dist/esm/internal/core.js.map +0 -1
- package/dist/esm/internal/diff.js.map +0 -1
- package/dist/esm/internal/effect-loop-operator.js +0 -269
- package/dist/esm/internal/effect-loop-operator.js.map +0 -1
- package/dist/esm/internal/effect-operator.js +0 -134
- package/dist/esm/internal/effect-operator.js.map +0 -1
- package/dist/esm/internal/effect-producer.js +0 -47
- package/dist/esm/internal/effect-producer.js.map +0 -1
- package/dist/esm/internal/helpers.js +0 -299
- package/dist/esm/internal/helpers.js.map +0 -1
- package/dist/esm/internal/keyed.js +0 -153
- package/dist/esm/internal/keyed.js.map +0 -1
- package/dist/esm/internal/loop-operator.js +0 -186
- package/dist/esm/internal/loop-operator.js.map +0 -1
- package/dist/esm/internal/operator.js +0 -68
- package/dist/esm/internal/operator.js.map +0 -1
- package/dist/esm/internal/protos.js +0 -39
- package/dist/esm/internal/protos.js.map +0 -1
- package/dist/esm/internal/provide.js +0 -72
- package/dist/esm/internal/provide.js.map +0 -1
- package/dist/esm/internal/requestIdleCallback.js +0 -16
- package/dist/esm/internal/requestIdleCallback.js.map +0 -1
- package/dist/esm/internal/share.js +0 -62
- package/dist/esm/internal/share.js.map +0 -1
- package/dist/esm/internal/strategies.js +0 -8
- package/dist/esm/internal/strategies.js.map +0 -1
- package/dist/esm/internal/sync-operator.js +0 -95
- package/dist/esm/internal/sync-operator.js.map +0 -1
- package/dist/esm/internal/sync-producer.js +0 -90
- package/dist/esm/internal/sync-producer.js.map +0 -1
- package/dist/esm/internal/withKey.js +0 -56
- package/dist/esm/internal/withKey.js.map +0 -1
- package/dist/esm/package.json +0 -4
- package/src/AsyncData.ts +0 -453
- package/src/Emitter.ts +0 -59
- package/src/Form.ts +0 -489
- package/src/FormEntry.ts +0 -214
- package/src/Idle.ts +0 -294
- package/src/Match.ts +0 -314
- package/src/Pull.ts +0 -95
- package/src/RefChunk.ts +0 -407
- package/src/RefHashMap.ts +0 -335
- package/src/RefHashSet.ts +0 -179
- package/src/Stream.ts +0 -140
- package/src/TypeId.ts +0 -59
- package/src/Typeclass.ts +0 -459
- package/src/internal/DeferredRef.ts +0 -72
- package/src/internal/UnionToTuple.ts +0 -11
- package/src/internal/bounds.ts +0 -21
- package/src/internal/core.ts +0 -3091
- package/src/internal/diff.ts +0 -171
- package/src/internal/effect-loop-operator.ts +0 -466
- package/src/internal/effect-operator.ts +0 -317
- package/src/internal/effect-producer.ts +0 -125
- package/src/internal/helpers.ts +0 -538
- package/src/internal/keyed.ts +0 -235
- package/src/internal/loop-operator.ts +0 -266
- package/src/internal/operator.ts +0 -87
- package/src/internal/protos.ts +0 -57
- package/src/internal/provide.ts +0 -151
- package/src/internal/requestIdleCallback.ts +0 -19
- package/src/internal/share.ts +0 -97
- package/src/internal/strategies.ts +0 -15
- package/src/internal/sync-operator.ts +0 -166
- package/src/internal/sync-producer.ts +0 -148
- package/src/internal/withKey.ts +0 -82
- /package/dist/{dts → Fx}/internal/UnionToTuple.d.ts +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Exit from "effect/Exit";
|
|
3
|
+
import { dual } from "effect/Function";
|
|
4
|
+
import * as Option from "effect/Option";
|
|
5
|
+
import * as Ref from "effect/Ref";
|
|
6
|
+
import { make as makeSink } from "../../Sink/Sink.js";
|
|
7
|
+
import { make } from "../constructors/make.js";
|
|
8
|
+
const toFinalizer = (f) => (exit) => {
|
|
9
|
+
const x = f(exit);
|
|
10
|
+
return Effect.isEffect(x) ? x : Effect.void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Adds an `Effect.onExit`-style finalizer to an `Fx`.
|
|
14
|
+
*
|
|
15
|
+
* The finalizer is run when the `Fx` terminates (success, failure, or interruption).
|
|
16
|
+
*
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
* @category combinators
|
|
19
|
+
*/
|
|
20
|
+
export const onExit = dual(2, (self, f) => make(Effect.fnUntraced(function* (sink) {
|
|
21
|
+
const finalizer = toFinalizer(f);
|
|
22
|
+
const observed = yield* Ref.make(Option.none());
|
|
23
|
+
const recordExit = (exit) => Ref.modify(observed, (current) => Option.isNone(current)
|
|
24
|
+
? [true, Option.some(exit)]
|
|
25
|
+
: [false, current]).pipe(Effect.asVoid);
|
|
26
|
+
const runFinalizer = (exit, allowReportFailure) => Effect.matchCauseEffect(finalizer(exit), {
|
|
27
|
+
onFailure: (cause) => (allowReportFailure ? sink.onFailure(cause) : Effect.void),
|
|
28
|
+
onSuccess: () => Effect.void,
|
|
29
|
+
});
|
|
30
|
+
return yield* self
|
|
31
|
+
.run(makeSink((cause) => Effect.flatMap(recordExit(Exit.failCause(cause)), () => sink.onFailure(cause)), sink.onSuccess))
|
|
32
|
+
.pipe(Effect.onExit((runExit) => Effect.flatMap(Ref.get(observed), (maybe) => Option.match(maybe, {
|
|
33
|
+
onSome: (exit) => runFinalizer(exit, false),
|
|
34
|
+
onNone: () => Exit.match(runExit, {
|
|
35
|
+
onFailure: (cause) => runFinalizer(Exit.failCause(cause), false),
|
|
36
|
+
onSuccess: () => runFinalizer(Exit.succeed(undefined), true),
|
|
37
|
+
}),
|
|
38
|
+
}))));
|
|
39
|
+
})));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { Fx } from "../Fx.js";
|
|
3
|
+
/**
|
|
4
|
+
* Adds an `Effect.onInterrupt`-style finalizer to an `Fx`.
|
|
5
|
+
*
|
|
6
|
+
* The finalizer is run only when the stream is interrupted (either via an
|
|
7
|
+
* interrupt cause or by interrupting the running fiber).
|
|
8
|
+
*
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category combinators
|
|
11
|
+
*/
|
|
12
|
+
export declare const onInterrupt: {
|
|
13
|
+
<XE, XR>(finalizer: Effect.Effect<void, XE, XR> | ((interruptors: ReadonlySet<number>) => Effect.Effect<void, XE, XR>)): <A, E, R>(self: Fx<A, E, R>) => Fx<A, E | XE, R | XR>;
|
|
14
|
+
<A, E, R, XE, XR>(self: Fx<A, E, R>, finalizer: Effect.Effect<void, XE, XR> | ((interruptors: ReadonlySet<number>) => Effect.Effect<void, XE, XR>)): Fx<A, E | XE, R | XR>;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=onInterrupt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onInterrupt.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/onInterrupt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAWnC;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,EAAE;IACxB,CAAC,EAAE,EAAE,EAAE,EACL,SAAS,EACL,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,GAC3B,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GACvE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAEzD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EACd,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACjB,SAAS,EACL,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,GAC3B,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,GACvE,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;CA+C1B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as Cause from "effect/Cause";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { dual } from "effect/Function";
|
|
4
|
+
import * as Option from "effect/Option";
|
|
5
|
+
import * as Ref from "effect/Ref";
|
|
6
|
+
import { make as makeSink } from "../../Sink/Sink.js";
|
|
7
|
+
import { make } from "../constructors/make.js";
|
|
8
|
+
const toFinalizer = (f) => (interruptors) => typeof f === "function" ? f(interruptors) : f;
|
|
9
|
+
/**
|
|
10
|
+
* Adds an `Effect.onInterrupt`-style finalizer to an `Fx`.
|
|
11
|
+
*
|
|
12
|
+
* The finalizer is run only when the stream is interrupted (either via an
|
|
13
|
+
* interrupt cause or by interrupting the running fiber).
|
|
14
|
+
*
|
|
15
|
+
* @since 1.0.0
|
|
16
|
+
* @category combinators
|
|
17
|
+
*/
|
|
18
|
+
export const onInterrupt = dual(2, (self, finalizer_) => make(Effect.fnUntraced(function* (sink) {
|
|
19
|
+
const finalizer = toFinalizer(finalizer_);
|
|
20
|
+
const interrupted = yield* Ref.make(Option.none());
|
|
21
|
+
const record = (ids) => Ref.modify(interrupted, (current) => Option.isNone(current)
|
|
22
|
+
? [true, Option.some(ids)]
|
|
23
|
+
: [false, current]);
|
|
24
|
+
const runFinalizer = (ids) => Effect.flatMap(record(ids), (first) => first
|
|
25
|
+
? Effect.matchCauseEffect(finalizer(ids), {
|
|
26
|
+
onFailure: () => Effect.void,
|
|
27
|
+
onSuccess: () => Effect.void,
|
|
28
|
+
})
|
|
29
|
+
: Effect.void);
|
|
30
|
+
return yield* self
|
|
31
|
+
.run(makeSink((cause) => Cause.hasInterruptsOnly(cause)
|
|
32
|
+
? Effect.matchCauseEffect(finalizer(Cause.interruptors(cause)), {
|
|
33
|
+
onFailure: (cause2) => sink.onFailure(Cause.combine(cause, cause2)),
|
|
34
|
+
onSuccess: () => sink.onFailure(cause),
|
|
35
|
+
})
|
|
36
|
+
: sink.onFailure(cause), sink.onSuccess))
|
|
37
|
+
.pipe(Effect.onInterrupt((ids) => runFinalizer(ids)));
|
|
38
|
+
})));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
import type * as ServiceMap from "effect/ServiceMap";
|
|
3
|
+
import type { Fx } from "../Fx.js";
|
|
4
|
+
/**
|
|
5
|
+
* Provides context to an Fx from a Layer.
|
|
6
|
+
*
|
|
7
|
+
* The context is provided to the entire Fx stream, including any effects run
|
|
8
|
+
* during its execution. The context is scoped to the lifetime of the stream.
|
|
9
|
+
*
|
|
10
|
+
* @param layer - The Layer to provide.
|
|
11
|
+
* @returns An `Fx` with the required context provided.
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category combinators
|
|
14
|
+
*/
|
|
15
|
+
export declare const provide: {
|
|
16
|
+
<R2, E2 = never, R3 = never>(layer: Layer.Layer<R2, E2, R3>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E | E2, Exclude<R, R2> | R3>;
|
|
17
|
+
<A, E, R, R2, E2 = never, R3 = never>(fx: Fx<A, E, R>, layer: Layer.Layer<R2, E2, R3>): Fx<A, E | E2, Exclude<R, R2> | R3>;
|
|
18
|
+
};
|
|
19
|
+
export declare const provideServices: {
|
|
20
|
+
<R2>(services: ServiceMap.ServiceMap<R2>): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, R2>>;
|
|
21
|
+
<A, E, R, R2>(fx: Fx<A, E, R>, services: ServiceMap.ServiceMap<R2>): Fx<A, E, Exclude<R, R2>>;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=provide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provide.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/provide.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,EAAE;IACpB,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EACzB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAC7B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAEpE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EAClC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACf,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAC7B,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;CAuBvC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE;IAC5B,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,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,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAElG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAK/F,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Exit from "effect/Exit";
|
|
3
|
+
import { dual } from "effect/Function";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as Scope from "effect/Scope";
|
|
6
|
+
import { make } from "../constructors/make.js";
|
|
7
|
+
/**
|
|
8
|
+
* Provides context to an Fx from a Layer.
|
|
9
|
+
*
|
|
10
|
+
* The context is provided to the entire Fx stream, including any effects run
|
|
11
|
+
* during its execution. The context is scoped to the lifetime of the stream.
|
|
12
|
+
*
|
|
13
|
+
* @param layer - The Layer to provide.
|
|
14
|
+
* @returns An `Fx` with the required context provided.
|
|
15
|
+
* @since 1.0.0
|
|
16
|
+
* @category combinators
|
|
17
|
+
*/
|
|
18
|
+
export const provide = dual(2, (fx, layer) => make(Effect.fnUntraced(function* (sink) {
|
|
19
|
+
const scope = yield* Scope.make();
|
|
20
|
+
const servicesExit = yield* layer.pipe(Layer.buildWithScope(scope), Effect.exit);
|
|
21
|
+
if (Exit.isFailure(servicesExit)) {
|
|
22
|
+
yield* Scope.close(scope, servicesExit);
|
|
23
|
+
return yield* sink.onFailure(servicesExit.cause);
|
|
24
|
+
}
|
|
25
|
+
return yield* fx.run(sink).pipe(Effect.provideServices(servicesExit.value), Effect.onExit((exit) => Scope.close(scope, exit)));
|
|
26
|
+
})));
|
|
27
|
+
export const provideServices = dual(2, (fx, services) => provide(fx, Layer.succeedServices(services)));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Fx } from "../Fx.js";
|
|
2
|
+
/**
|
|
3
|
+
* Skips the first `n` elements of an Fx.
|
|
4
|
+
*
|
|
5
|
+
* @param n - The number of elements to skip.
|
|
6
|
+
* @returns An `Fx` that emits values after the first `n` elements.
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @category combinators
|
|
9
|
+
*/
|
|
10
|
+
export declare const skip: {
|
|
11
|
+
(n: number): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;
|
|
12
|
+
<A, E, R>(fx: Fx<A, E, R>, n: number): Fx<A, E, R>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=skip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/skip.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAGnC;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,CAAC,EAAE,MAAM,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,CAAC,CAAC;IAEvD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAIpD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { dual } from "effect/Function";
|
|
2
|
+
import { slice } from "./slice.js";
|
|
3
|
+
/**
|
|
4
|
+
* Skips the first `n` elements of an Fx.
|
|
5
|
+
*
|
|
6
|
+
* @param n - The number of elements to skip.
|
|
7
|
+
* @returns An `Fx` that emits values after the first `n` elements.
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category combinators
|
|
10
|
+
*/
|
|
11
|
+
export const skip = dual(2, (fx, n) => slice(fx, { skip: n, take: Infinity }));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Fx } from "../Fx.js";
|
|
2
|
+
/**
|
|
3
|
+
* Drops elements that are equal to the previous element using standard equality.
|
|
4
|
+
*
|
|
5
|
+
* @param fx - The `Fx` stream.
|
|
6
|
+
* @returns An `Fx` with consecutive duplicates removed.
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @category combinators
|
|
9
|
+
*/
|
|
10
|
+
export declare const skipRepeats: <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;
|
|
11
|
+
//# sourceMappingURL=skipRepeats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skipRepeats.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/skipRepeats.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAKnC;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,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,CAAgB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { equals } from "effect/Equal";
|
|
2
|
+
import { skipRepeatsWith } from "./skipRepeatsWith.js";
|
|
3
|
+
const skipRepeats_ = skipRepeatsWith(equals);
|
|
4
|
+
/**
|
|
5
|
+
* Drops elements that are equal to the previous element using standard equality.
|
|
6
|
+
*
|
|
7
|
+
* @param fx - The `Fx` stream.
|
|
8
|
+
* @returns An `Fx` with consecutive duplicates removed.
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category combinators
|
|
11
|
+
*/
|
|
12
|
+
export const skipRepeats = skipRepeats_;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as Equivalence from "effect/Equivalence";
|
|
2
|
+
import type { Fx } from "../Fx.js";
|
|
3
|
+
/**
|
|
4
|
+
* Drops elements that are equal to the previous element using a custom equivalence function.
|
|
5
|
+
*
|
|
6
|
+
* @param Eq - The equivalence function to use.
|
|
7
|
+
* @returns An `Fx` with consecutive duplicates removed.
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category combinators
|
|
10
|
+
*/
|
|
11
|
+
export declare const skipRepeatsWith: <A>(Eq: Equivalence.Equivalence<A>) => <E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;
|
|
12
|
+
//# sourceMappingURL=skipRepeatsWith.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skipRepeatsWith.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/skipRepeatsWith.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAMvD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GACzB,CAAC,EAAE,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,MACjC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAoBhC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Option from "effect/Option";
|
|
3
|
+
import * as Ref from "effect/Ref";
|
|
4
|
+
import * as sinkCore from "../../Sink/combinators.js";
|
|
5
|
+
import { make as makeSink } from "../../Sink/Sink.js";
|
|
6
|
+
import { make } from "../constructors/make.js";
|
|
7
|
+
/**
|
|
8
|
+
* Drops elements that are equal to the previous element using a custom equivalence function.
|
|
9
|
+
*
|
|
10
|
+
* @param Eq - The equivalence function to use.
|
|
11
|
+
* @returns An `Fx` with consecutive duplicates removed.
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category combinators
|
|
14
|
+
*/
|
|
15
|
+
export const skipRepeatsWith = (Eq) => (fx) => make((sink) => sinkCore.withState(sink, Option.none(), (sink) => fx.run(makeSink(sink.onFailure, (a2) => Effect.flatten(Ref.modify(sink.state, Option.match({
|
|
16
|
+
onNone: () => [sink.onSuccess(a2), Option.some(a2)],
|
|
17
|
+
onSome: (a) => Eq(a, a2)
|
|
18
|
+
? [Effect.void, Option.some(a)]
|
|
19
|
+
: [sink.onSuccess(a2), Option.some(a2)],
|
|
20
|
+
})))))));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Fx } from "../Fx.js";
|
|
2
|
+
/**
|
|
3
|
+
* Defines the bounds for slicing an Fx stream.
|
|
4
|
+
* @since 1.0.0
|
|
5
|
+
* @category models
|
|
6
|
+
*/
|
|
7
|
+
export interface Bounds {
|
|
8
|
+
readonly skip: number;
|
|
9
|
+
readonly take: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Slices an Fx by skipping a number of elements and then taking a number of elements.
|
|
13
|
+
*
|
|
14
|
+
* @param bounds - The `Bounds` specifying how many elements to skip and take.
|
|
15
|
+
* @returns An `Fx` representing the slice.
|
|
16
|
+
* @since 1.0.0
|
|
17
|
+
* @category combinators
|
|
18
|
+
*/
|
|
19
|
+
export declare const slice: {
|
|
20
|
+
(bounds: Bounds): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;
|
|
21
|
+
<A, E, R>(fx: Fx<A, E, R>, bounds: Bounds): Fx<A, E, R>;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=slice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slice.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/slice.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE;IAClB,CAAC,MAAM,EAAE,MAAM,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,CAAC,CAAC;IAE5D,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAKzD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { dual } from "effect/Function";
|
|
2
|
+
import * as sinkCore from "../../Sink/combinators.js";
|
|
3
|
+
import { make } from "../constructors/make.js";
|
|
4
|
+
/**
|
|
5
|
+
* Slices an Fx by skipping a number of elements and then taking a number of elements.
|
|
6
|
+
*
|
|
7
|
+
* @param bounds - The `Bounds` specifying how many elements to skip and take.
|
|
8
|
+
* @returns An `Fx` representing the slice.
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category combinators
|
|
11
|
+
*/
|
|
12
|
+
export const slice = dual(2, (fx, bounds) => make((sink) => sinkCore.slice(sink, bounds, (sink) => fx.run(sink))));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FlatMapLike } from "./flatMap.js";
|
|
2
|
+
/**
|
|
3
|
+
* Maps each element of an Fx to a new Fx, and switches to the latest inner Fx.
|
|
4
|
+
*
|
|
5
|
+
* When a new element is emitted, the previous inner Fx is cancelled.
|
|
6
|
+
*
|
|
7
|
+
* @param f - A function that maps an element `A` to a new `Fx<B>`.
|
|
8
|
+
* @returns An `Fx` that emits values from the latest inner stream.
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category combinators
|
|
11
|
+
*/
|
|
12
|
+
export declare const switchMap: FlatMapLike;
|
|
13
|
+
//# sourceMappingURL=switchMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switchMap.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/switchMap.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,EAAE,WAgCvB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Fiber from "effect/Fiber";
|
|
3
|
+
import { dual } from "effect/Function";
|
|
4
|
+
import * as Scope from "effect/Scope";
|
|
5
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
6
|
+
import * as SyncronizedRef from "effect/SynchronizedRef";
|
|
7
|
+
import { make as makeSink } from "../../Sink/Sink.js";
|
|
8
|
+
import { make } from "../constructors/make.js";
|
|
9
|
+
import { extendScope } from "../internal/scope.js";
|
|
10
|
+
/**
|
|
11
|
+
* Maps each element of an Fx to a new Fx, and switches to the latest inner Fx.
|
|
12
|
+
*
|
|
13
|
+
* When a new element is emitted, the previous inner Fx is cancelled.
|
|
14
|
+
*
|
|
15
|
+
* @param f - A function that maps an element `A` to a new `Fx<B>`.
|
|
16
|
+
* @returns An `Fx` that emits values from the latest inner stream.
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
* @category combinators
|
|
19
|
+
*/
|
|
20
|
+
export const switchMap = dual(2, (self, f) => make(Effect.fn(function* (sink) {
|
|
21
|
+
const ctx = yield* Effect.services();
|
|
22
|
+
const scope = ServiceMap.get(ctx, Scope.Scope);
|
|
23
|
+
const fiberRef = yield* SyncronizedRef.make(null);
|
|
24
|
+
const next = (value) => Effect.forkIn(Effect.provideServices(f(value).run(sink), ctx), scope, {
|
|
25
|
+
startImmediately: false,
|
|
26
|
+
uninterruptible: false,
|
|
27
|
+
});
|
|
28
|
+
yield* self.run(makeSink(sink.onFailure, (value) => SyncronizedRef.updateEffect(fiberRef, (fiber) => fiber ? Fiber.interrupt(fiber).pipe(Effect.flatMap(() => next(value))) : next(value))));
|
|
29
|
+
const fiber = yield* SyncronizedRef.get(fiberRef);
|
|
30
|
+
if (fiber) {
|
|
31
|
+
yield* Fiber.join(fiber);
|
|
32
|
+
}
|
|
33
|
+
}, extendScope)));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FlatMapEffectLike } from "./flatMapEffect.js";
|
|
2
|
+
/**
|
|
3
|
+
* Maps each element of an Fx to an Effect, and switches to the latest effect.
|
|
4
|
+
*
|
|
5
|
+
* When a new element is emitted, the previous effect is cancelled.
|
|
6
|
+
*
|
|
7
|
+
* @param f - A function that maps an element `A` to an `Effect<B>`.
|
|
8
|
+
* @returns An `Fx` that emits the results of the latest effect.
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category combinators
|
|
11
|
+
*/
|
|
12
|
+
export declare const switchMapEffect: FlatMapEffectLike;
|
|
13
|
+
//# sourceMappingURL=switchMapEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switchMapEffect.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/switchMapEffect.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,iBAM7B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { dual, flow } from "effect/Function";
|
|
2
|
+
import { fromEffect } from "../constructors/fromEffect.js";
|
|
3
|
+
import { switchMap } from "./switchMap.js";
|
|
4
|
+
/**
|
|
5
|
+
* Maps each element of an Fx to an Effect, and switches to the latest effect.
|
|
6
|
+
*
|
|
7
|
+
* When a new element is emitted, the previous effect is cancelled.
|
|
8
|
+
*
|
|
9
|
+
* @param f - A function that maps an element `A` to an `Effect<B>`.
|
|
10
|
+
* @returns An `Fx` that emits the results of the latest effect.
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
* @category combinators
|
|
13
|
+
*/
|
|
14
|
+
export const switchMapEffect = dual(2, (self, f) => switchMap(self, flow(f, fromEffect)));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Fx } from "../Fx.js";
|
|
2
|
+
/**
|
|
3
|
+
* Takes the first `n` elements from an Fx and then completes.
|
|
4
|
+
*
|
|
5
|
+
* @param n - The number of elements to take.
|
|
6
|
+
* @returns An `Fx` that emits at most `n` elements.
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @category combinators
|
|
9
|
+
*/
|
|
10
|
+
export declare const take: {
|
|
11
|
+
(n: number): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;
|
|
12
|
+
<A, E, R>(fx: Fx<A, E, R>, n: number): Fx<A, E, R>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=take.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"take.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/take.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAGnC;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,CAAC,CAAC,EAAE,MAAM,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,CAAC,CAAC;IAEvD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAC6C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { dual } from "effect/Function";
|
|
2
|
+
import { slice } from "./slice.js";
|
|
3
|
+
/**
|
|
4
|
+
* Takes the first `n` elements from an Fx and then completes.
|
|
5
|
+
*
|
|
6
|
+
* @param n - The number of elements to take.
|
|
7
|
+
* @returns An `Fx` that emits at most `n` elements.
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category combinators
|
|
10
|
+
*/
|
|
11
|
+
export const take = dual(2, (fx, n) => slice(fx, { skip: 0, take: n }));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Fx } from "../Fx.js";
|
|
2
|
+
/**
|
|
3
|
+
* Takes elements from an Fx until a predicate returns true.
|
|
4
|
+
* The element that satisfies the predicate is not included in the output.
|
|
5
|
+
*
|
|
6
|
+
* @param predicate - The predicate function.
|
|
7
|
+
* @returns An `Fx` that completes when the predicate matches.
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category combinators
|
|
10
|
+
*/
|
|
11
|
+
export declare const takeUntil: {
|
|
12
|
+
<A>(predicate: (a: A) => boolean): <E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;
|
|
13
|
+
<A, E, R>(fx: Fx<A, E, R>, predicate: (a: A) => boolean): Fx<A, E, R>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Drops elements from an Fx after a predicate returns true.
|
|
17
|
+
* The element that satisfies the predicate is included in the output.
|
|
18
|
+
*
|
|
19
|
+
* @param predicate - The predicate function.
|
|
20
|
+
* @returns An `Fx` that stops emitting when the predicate matches.
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category combinators
|
|
23
|
+
*/
|
|
24
|
+
export declare const dropAfter: {
|
|
25
|
+
<A>(predicate: (a: A) => boolean): <E, R>(fx: Fx<A, E, R>) => Fx<A, E, R>;
|
|
26
|
+
<A, E, R>(fx: Fx<A, E, R>, predicate: (a: A) => boolean): Fx<A, E, R>;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=takeUntil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"takeUntil.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/takeUntil.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,EAAE;IACtB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CActE,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,EAAE;IACtB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAKvE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { dual } from "effect/Function";
|
|
2
|
+
import * as combinators from "../../Sink/combinators.js";
|
|
3
|
+
import { make as makeSink } from "../../Sink/Sink.js";
|
|
4
|
+
import { make as makeFx } from "../constructors/make.js";
|
|
5
|
+
/**
|
|
6
|
+
* Takes elements from an Fx until a predicate returns true.
|
|
7
|
+
* The element that satisfies the predicate is not included in the output.
|
|
8
|
+
*
|
|
9
|
+
* @param predicate - The predicate function.
|
|
10
|
+
* @returns An `Fx` that completes when the predicate matches.
|
|
11
|
+
* @since 1.0.0
|
|
12
|
+
* @category combinators
|
|
13
|
+
*/
|
|
14
|
+
export const takeUntil = dual(2, (fx, predicate) => {
|
|
15
|
+
return makeFx((sink) => combinators.withEarlyExit(sink, (sink) => fx.run(makeSink(sink.onFailure, (a) => {
|
|
16
|
+
if (predicate(a)) {
|
|
17
|
+
return sink.earlyExit;
|
|
18
|
+
}
|
|
19
|
+
return sink.onSuccess(a);
|
|
20
|
+
}))));
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Drops elements from an Fx after a predicate returns true.
|
|
24
|
+
* The element that satisfies the predicate is included in the output.
|
|
25
|
+
*
|
|
26
|
+
* @param predicate - The predicate function.
|
|
27
|
+
* @returns An `Fx` that stops emitting when the predicate matches.
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
* @category combinators
|
|
30
|
+
*/
|
|
31
|
+
export const dropAfter = dual(2, (fx, predicate) => makeFx((sink) => combinators.dropAfter(sink, predicate, (sink) => fx.run(sink))));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { Fx } from "../Fx.js";
|
|
3
|
+
/**
|
|
4
|
+
* Performs an effect for each element of the Fx, without changing the elements.
|
|
5
|
+
*
|
|
6
|
+
* @param f - An effectful function to apply to each element.
|
|
7
|
+
* @returns An `Fx` that emits the original elements.
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category combinators
|
|
10
|
+
*/
|
|
11
|
+
export declare const tap: {
|
|
12
|
+
<A, E2 = never, R2 = never>(f: (a: A) => void | Effect.Effect<unknown, E2, R2>): <E, R>(self: Fx<A, E | E2, R>) => Fx<A, E | E2, R | R2>;
|
|
13
|
+
<A, E, R, E2 = never, R2 = never>(self: Fx<A, E | E2, R>, f: (a: A) => void | Effect.Effect<unknown, E2, R2>): Fx<A, E | E2, R | R2>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=tapEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tapEffect.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/tapEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE;IAChB,CAAC,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EACxB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,GACjD,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3D,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK,EAC9B,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EACtB,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,GACjD,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;CAgB1B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { dual } from "effect/Function";
|
|
3
|
+
import * as sinkCore from "../../Sink/combinators.js";
|
|
4
|
+
import { make } from "../constructors/make.js";
|
|
5
|
+
/**
|
|
6
|
+
* Performs an effect for each element of the Fx, without changing the elements.
|
|
7
|
+
*
|
|
8
|
+
* @param f - An effectful function to apply to each element.
|
|
9
|
+
* @returns An `Fx` that emits the original elements.
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
* @category combinators
|
|
12
|
+
*/
|
|
13
|
+
export const tap = dual(2, (self, f) => make((sink) => self.run(sinkCore.tapEffect(sink, (a) => {
|
|
14
|
+
const x = f(a);
|
|
15
|
+
if (Effect.isEffect(x))
|
|
16
|
+
return x;
|
|
17
|
+
return Effect.void;
|
|
18
|
+
}))));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Fx } from "../Fx.js";
|
|
2
|
+
/**
|
|
3
|
+
* Combines multiple Fx streams into a single Fx that emits a tuple of the latest values from each stream.
|
|
4
|
+
* The resulting Fx waits for all input streams to emit at least once before emitting the first tuple.
|
|
5
|
+
* Afterwards, it emits a new tuple whenever any input stream emits a new value.
|
|
6
|
+
*
|
|
7
|
+
* @param fxs - The Fx streams to combine.
|
|
8
|
+
* @returns An `Fx` emitting tuples of values.
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category combinators
|
|
11
|
+
*/
|
|
12
|
+
export declare function tuple<FX extends ReadonlyArray<Fx<any, any, any>>>(...fxs: FX): Fx<{
|
|
13
|
+
readonly [K in keyof FX]: Fx.Success<FX[K]>;
|
|
14
|
+
}, Fx.Error<FX[number]>, Fx.Services<FX[number]>>;
|
|
15
|
+
/**
|
|
16
|
+
* Combines a record of Fx streams into a single Fx that emits a record of the latest values.
|
|
17
|
+
* Similar to `tuple`, but for objects.
|
|
18
|
+
*
|
|
19
|
+
* @param fxs - A record of Fx streams.
|
|
20
|
+
* @returns An `Fx` emitting records of values.
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category combinators
|
|
23
|
+
*/
|
|
24
|
+
export declare function struct<FXS extends Readonly<Record<string, Fx<any, any, any>>>>(fxs: FXS): Fx<{
|
|
25
|
+
readonly [K in keyof FXS]: Fx.Success<FXS[K]>;
|
|
26
|
+
}, Fx.Error<FXS[keyof FXS]>, Fx.Services<FXS[keyof FXS]>>;
|
|
27
|
+
//# sourceMappingURL=tuple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/tuple.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAGnC;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,EAAE,SAAS,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAC/D,GAAG,GAAG,EAAE,EAAE,GACT,EAAE,CACH;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EAC/C,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EACpB,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CACxB,CA+BA;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAAC,GAAG,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAC5E,GAAG,EAAE,GAAG,GACP,EAAE,CACH;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,EACjD,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,EACxB,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAC5B,CAOA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { make as makeSink } from "../../Sink/Sink.js";
|
|
3
|
+
import { make } from "../constructors/make.js";
|
|
4
|
+
import { succeed } from "../constructors/succeed.js";
|
|
5
|
+
import { map } from "./map.js";
|
|
6
|
+
/**
|
|
7
|
+
* Combines multiple Fx streams into a single Fx that emits a tuple of the latest values from each stream.
|
|
8
|
+
* The resulting Fx waits for all input streams to emit at least once before emitting the first tuple.
|
|
9
|
+
* Afterwards, it emits a new tuple whenever any input stream emits a new value.
|
|
10
|
+
*
|
|
11
|
+
* @param fxs - The Fx streams to combine.
|
|
12
|
+
* @returns An `Fx` emitting tuples of values.
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @category combinators
|
|
15
|
+
*/
|
|
16
|
+
export function tuple(...fxs) {
|
|
17
|
+
if (fxs.length === 0)
|
|
18
|
+
return succeed([]);
|
|
19
|
+
if (fxs.length === 1)
|
|
20
|
+
return fxs[0];
|
|
21
|
+
return make(Effect.fn(function* (sink) {
|
|
22
|
+
const len = fxs.length;
|
|
23
|
+
// oxlint-disable-next-line unicorn/no-new-array
|
|
24
|
+
const result = new Array(len);
|
|
25
|
+
const filled = new Set();
|
|
26
|
+
return yield* Effect.forEach(fxs, (fx, i) => fx.run(makeSink(sink.onFailure, Effect.fn(function* (value) {
|
|
27
|
+
result[i] = value;
|
|
28
|
+
filled.add(i);
|
|
29
|
+
if (filled.size === len) {
|
|
30
|
+
yield* sink.onSuccess(result);
|
|
31
|
+
}
|
|
32
|
+
}))), { concurrency: "unbounded", discard: true });
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Combines a record of Fx streams into a single Fx that emits a record of the latest values.
|
|
37
|
+
* Similar to `tuple`, but for objects.
|
|
38
|
+
*
|
|
39
|
+
* @param fxs - A record of Fx streams.
|
|
40
|
+
* @returns An `Fx` emitting records of values.
|
|
41
|
+
* @since 1.0.0
|
|
42
|
+
* @category combinators
|
|
43
|
+
*/
|
|
44
|
+
export function struct(fxs) {
|
|
45
|
+
return map(tuple(...Object.entries(fxs).map(([key, fx]) => map(fx, (value) => [key, value]))), Object.fromEntries);
|
|
46
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { Fx } from "../Fx.js";
|
|
3
|
+
/**
|
|
4
|
+
* Unwraps an Effect that produces an Fx into a single Fx.
|
|
5
|
+
*
|
|
6
|
+
* @param effect - An `Effect` that produces an `Fx`.
|
|
7
|
+
* @returns An `Fx` that runs the effect and then the produced Fx.
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category combinators
|
|
10
|
+
*/
|
|
11
|
+
export declare const unwrap: <A, E, R, E2, R2>(effect: Effect.Effect<Fx<A, E, R>, E2, R2>) => Fx<A, E | E2, R | R2>;
|
|
12
|
+
//# sourceMappingURL=unwrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwrap.d.ts","sourceRoot":"","sources":["../../../src/Fx/combinators/unwrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EACpC,QAAQ,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,KACzC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAMpB,CAAC"}
|