@typed/fx 1.18.4 → 1.20.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/AsyncData/package.json +6 -0
- package/Emitter/package.json +6 -0
- package/Form/package.json +6 -0
- package/FormEntry/package.json +6 -0
- package/Fx/package.json +6 -0
- package/Guard/package.json +6 -0
- package/Idle/package.json +6 -0
- package/Match/package.json +6 -0
- package/Pull/package.json +6 -0
- package/Push/package.json +6 -0
- package/RefArray/package.json +6 -0
- package/RefChunk/package.json +6 -0
- package/RefHashMap/package.json +6 -0
- package/RefHashSet/package.json +6 -0
- package/RefSubject/package.json +6 -0
- package/Sink/package.json +6 -0
- package/Stream/package.json +6 -0
- package/Subject/package.json +6 -0
- package/TypeId/package.json +6 -0
- package/Typeclass/package.json +6 -0
- package/Versioned/package.json +6 -0
- package/dist/cjs/AsyncData.js +177 -0
- package/dist/cjs/AsyncData.js.map +1 -0
- package/dist/cjs/Emitter.js +24 -21
- package/dist/cjs/Emitter.js.map +1 -1
- package/dist/cjs/Form.js +78 -21
- package/dist/cjs/Form.js.map +1 -1
- package/dist/cjs/FormEntry.js +75 -48
- package/dist/cjs/FormEntry.js.map +1 -1
- package/dist/cjs/Fx.js +517 -872
- package/dist/cjs/Fx.js.map +1 -1
- package/dist/cjs/Guard.js +21 -13
- package/dist/cjs/Guard.js.map +1 -1
- package/dist/cjs/Idle.js +49 -37
- package/dist/cjs/Idle.js.map +1 -1
- package/dist/cjs/Match.js +99 -61
- package/dist/cjs/Match.js.map +1 -1
- package/dist/cjs/Pull.js.map +1 -1
- package/dist/cjs/Push.js +168 -0
- package/dist/cjs/Push.js.map +1 -0
- package/dist/cjs/RefArray.js +32 -30
- package/dist/cjs/RefArray.js.map +1 -1
- package/dist/cjs/RefChunk.js +26 -24
- package/dist/cjs/RefChunk.js.map +1 -1
- package/dist/cjs/RefHashMap.js +20 -20
- package/dist/cjs/RefHashMap.js.map +1 -1
- package/dist/cjs/RefHashSet.js +11 -8
- package/dist/cjs/RefHashSet.js.map +1 -1
- package/dist/cjs/RefSubject.js +899 -158
- package/dist/cjs/RefSubject.js.map +1 -1
- package/dist/cjs/Sink.js +588 -62
- package/dist/cjs/Sink.js.map +1 -1
- package/dist/cjs/Stream.js +15 -10
- package/dist/cjs/Stream.js.map +1 -1
- package/dist/cjs/Subject.js +153 -55
- package/dist/cjs/Subject.js.map +1 -1
- package/dist/cjs/TypeId.js +10 -5
- package/dist/cjs/TypeId.js.map +1 -1
- package/dist/cjs/Typeclass.js +28 -31
- package/dist/cjs/Typeclass.js.map +1 -1
- package/dist/cjs/Versioned.js +118 -57
- package/dist/cjs/Versioned.js.map +1 -1
- package/dist/cjs/index.js +44 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/{deferred-ref.js → DeferredRef.js} +45 -13
- package/dist/cjs/internal/DeferredRef.js.map +1 -0
- package/dist/cjs/internal/UnionToTuple.js +6 -0
- package/dist/cjs/internal/UnionToTuple.js.map +1 -0
- package/dist/cjs/internal/core.js +1590 -779
- package/dist/cjs/internal/core.js.map +1 -1
- package/dist/cjs/internal/diff.js +114 -0
- package/dist/cjs/internal/diff.js.map +1 -0
- package/dist/cjs/internal/effect-loop-operator.js +288 -0
- package/dist/cjs/internal/effect-loop-operator.js.map +1 -0
- package/dist/cjs/internal/effect-operator.js +46 -37
- package/dist/cjs/internal/effect-operator.js.map +1 -1
- package/dist/cjs/internal/effect-producer.js +74 -0
- package/dist/cjs/internal/effect-producer.js.map +1 -0
- package/dist/cjs/internal/helpers.js +158 -128
- package/dist/cjs/internal/helpers.js.map +1 -1
- package/dist/cjs/internal/keyed.js +136 -173
- package/dist/cjs/internal/keyed.js.map +1 -1
- package/dist/cjs/internal/loop-operator.js +213 -0
- package/dist/cjs/internal/loop-operator.js.map +1 -0
- package/dist/cjs/internal/operator.js +79 -0
- package/dist/cjs/internal/operator.js.map +1 -0
- package/dist/cjs/internal/protos.js +19 -81
- package/dist/cjs/internal/protos.js.map +1 -1
- package/dist/cjs/internal/provide.js +47 -25
- package/dist/cjs/internal/provide.js.map +1 -1
- package/dist/cjs/internal/requestIdleCallback.js +5 -5
- package/dist/cjs/internal/requestIdleCallback.js.map +1 -1
- package/dist/cjs/internal/share.js +12 -15
- package/dist/cjs/internal/share.js.map +1 -1
- package/dist/cjs/internal/sync-operator.js +50 -22
- package/dist/cjs/internal/sync-operator.js.map +1 -1
- package/dist/cjs/internal/sync-producer.js +114 -0
- package/dist/cjs/internal/sync-producer.js.map +1 -0
- package/dist/cjs/internal/withKey.js +45 -51
- package/dist/cjs/internal/withKey.js.map +1 -1
- package/dist/dts/AsyncData.d.ts +185 -0
- package/dist/dts/AsyncData.d.ts.map +1 -0
- package/dist/dts/Emitter.d.ts +13 -20
- package/dist/dts/Emitter.d.ts.map +1 -1
- package/dist/dts/Form.d.ts +45 -28
- package/dist/dts/Form.d.ts.map +1 -1
- package/dist/dts/FormEntry.d.ts +25 -13
- package/dist/dts/FormEntry.d.ts.map +1 -1
- package/dist/dts/Fx.d.ts +983 -1387
- package/dist/dts/Fx.d.ts.map +1 -1
- package/dist/dts/Guard.d.ts +8 -1
- package/dist/dts/Guard.d.ts.map +1 -1
- package/dist/dts/Idle.d.ts +3 -3
- package/dist/dts/Idle.d.ts.map +1 -1
- package/dist/dts/Match.d.ts +8 -8
- package/dist/dts/Match.d.ts.map +1 -1
- package/dist/dts/Pull.d.ts +5 -5
- package/dist/dts/Pull.d.ts.map +1 -1
- package/dist/dts/Push.d.ts +170 -0
- package/dist/dts/Push.d.ts.map +1 -0
- package/dist/dts/RefArray.d.ts +21 -23
- package/dist/dts/RefArray.d.ts.map +1 -1
- package/dist/dts/RefChunk.d.ts +17 -19
- package/dist/dts/RefChunk.d.ts.map +1 -1
- package/dist/dts/RefHashMap.d.ts +19 -20
- package/dist/dts/RefHashMap.d.ts.map +1 -1
- package/dist/dts/RefHashSet.d.ts +12 -16
- package/dist/dts/RefHashSet.d.ts.map +1 -1
- package/dist/dts/RefSubject.d.ts +396 -187
- package/dist/dts/RefSubject.d.ts.map +1 -1
- package/dist/dts/Sink.d.ts +193 -93
- package/dist/dts/Sink.d.ts.map +1 -1
- package/dist/dts/Stream.d.ts +7 -1
- package/dist/dts/Stream.d.ts.map +1 -1
- package/dist/dts/Subject.d.ts +27 -36
- package/dist/dts/Subject.d.ts.map +1 -1
- package/dist/dts/TypeId.d.ts +10 -0
- package/dist/dts/TypeId.d.ts.map +1 -1
- package/dist/dts/Typeclass.d.ts +2 -2
- package/dist/dts/Typeclass.d.ts.map +1 -1
- package/dist/dts/Versioned.d.ts +50 -78
- package/dist/dts/Versioned.d.ts.map +1 -1
- package/dist/dts/index.d.ts +66 -6
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/DeferredRef.d.ts +20 -0
- package/dist/dts/internal/DeferredRef.d.ts.map +1 -0
- package/dist/dts/internal/UnionToTuple.d.ts +6 -0
- package/dist/dts/internal/UnionToTuple.d.ts.map +1 -0
- package/dist/dts/internal/core.d.ts +218 -450
- package/dist/dts/internal/core.d.ts.map +1 -1
- package/dist/dts/internal/diff.d.ts +38 -0
- package/dist/dts/internal/diff.d.ts.map +1 -0
- package/dist/dts/internal/effect-loop-operator.d.ts +34 -0
- package/dist/dts/internal/effect-loop-operator.d.ts.map +1 -0
- package/dist/dts/internal/effect-operator.d.ts +8 -5
- package/dist/dts/internal/effect-operator.d.ts.map +1 -1
- package/dist/dts/internal/effect-producer.d.ts +25 -0
- package/dist/dts/internal/effect-producer.d.ts.map +1 -0
- package/dist/dts/internal/helpers.d.ts +33 -24
- package/dist/dts/internal/helpers.d.ts.map +1 -1
- package/dist/dts/internal/keyed.d.ts +3 -3
- package/dist/dts/internal/keyed.d.ts.map +1 -1
- package/dist/dts/internal/loop-operator.d.ts +40 -0
- package/dist/dts/internal/loop-operator.d.ts.map +1 -0
- package/dist/dts/internal/operator.d.ts +16 -0
- package/dist/dts/internal/operator.d.ts.map +1 -0
- package/dist/dts/internal/protos.d.ts +16 -43
- package/dist/dts/internal/protos.d.ts.map +1 -1
- package/dist/dts/internal/provide.d.ts +7 -1
- package/dist/dts/internal/provide.d.ts.map +1 -1
- package/dist/dts/internal/share.d.ts +12 -9
- package/dist/dts/internal/share.d.ts.map +1 -1
- package/dist/dts/internal/sync-operator.d.ts +7 -3
- package/dist/dts/internal/sync-operator.d.ts.map +1 -1
- package/dist/dts/internal/sync-producer.d.ts +36 -0
- package/dist/dts/internal/sync-producer.d.ts.map +1 -0
- package/dist/dts/internal/withKey.d.ts +3 -3
- package/dist/dts/internal/withKey.d.ts.map +1 -1
- package/dist/esm/AsyncData.js +151 -0
- package/dist/esm/AsyncData.js.map +1 -0
- package/dist/esm/Emitter.js +24 -21
- package/dist/esm/Emitter.js.map +1 -1
- package/dist/esm/Form.js +69 -14
- package/dist/esm/Form.js.map +1 -1
- package/dist/esm/FormEntry.js +77 -52
- package/dist/esm/FormEntry.js.map +1 -1
- package/dist/esm/Fx.js +509 -874
- package/dist/esm/Fx.js.map +1 -1
- package/dist/esm/Guard.js +5 -1
- package/dist/esm/Guard.js.map +1 -1
- package/dist/esm/Idle.js +49 -39
- package/dist/esm/Idle.js.map +1 -1
- package/dist/esm/Match.js +103 -63
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Pull.js.map +1 -1
- package/dist/esm/Push.js +159 -0
- package/dist/esm/Push.js.map +1 -0
- package/dist/esm/RefArray.js +32 -30
- package/dist/esm/RefArray.js.map +1 -1
- package/dist/esm/RefChunk.js +26 -24
- package/dist/esm/RefChunk.js.map +1 -1
- package/dist/esm/RefHashMap.js +20 -20
- package/dist/esm/RefHashMap.js.map +1 -1
- package/dist/esm/RefHashSet.js +11 -8
- package/dist/esm/RefHashSet.js.map +1 -1
- package/dist/esm/RefSubject.js +873 -150
- package/dist/esm/RefSubject.js.map +1 -1
- package/dist/esm/Sink.js +608 -57
- package/dist/esm/Sink.js.map +1 -1
- package/dist/esm/Stream.js +13 -9
- package/dist/esm/Stream.js.map +1 -1
- package/dist/esm/Subject.js +151 -56
- package/dist/esm/Subject.js.map +1 -1
- package/dist/esm/TypeId.js +9 -4
- package/dist/esm/TypeId.js.map +1 -1
- package/dist/esm/Typeclass.js +29 -29
- package/dist/esm/Typeclass.js.map +1 -1
- package/dist/esm/Versioned.js +110 -53
- package/dist/esm/Versioned.js.map +1 -1
- package/dist/esm/index.js +66 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/DeferredRef.js +54 -0
- package/dist/esm/internal/DeferredRef.js.map +1 -0
- package/dist/esm/internal/UnionToTuple.js +2 -0
- package/dist/esm/internal/UnionToTuple.js.map +1 -0
- package/dist/esm/internal/core.js +1439 -719
- package/dist/esm/internal/core.js.map +1 -1
- package/dist/esm/internal/diff.js +82 -0
- package/dist/esm/internal/diff.js.map +1 -0
- package/dist/esm/internal/effect-loop-operator.js +269 -0
- package/dist/esm/internal/effect-loop-operator.js.map +1 -0
- package/dist/esm/internal/effect-operator.js +44 -37
- package/dist/esm/internal/effect-operator.js.map +1 -1
- package/dist/esm/internal/effect-producer.js +47 -0
- package/dist/esm/internal/effect-producer.js.map +1 -0
- package/dist/esm/internal/helpers.js +157 -129
- package/dist/esm/internal/helpers.js.map +1 -1
- package/dist/esm/internal/keyed.js +128 -139
- package/dist/esm/internal/keyed.js.map +1 -1
- package/dist/esm/internal/loop-operator.js +186 -0
- package/dist/esm/internal/loop-operator.js.map +1 -0
- package/dist/esm/internal/operator.js +68 -0
- package/dist/esm/internal/operator.js.map +1 -0
- package/dist/esm/internal/protos.js +16 -75
- package/dist/esm/internal/protos.js.map +1 -1
- package/dist/esm/internal/provide.js +33 -25
- package/dist/esm/internal/provide.js.map +1 -1
- package/dist/esm/internal/requestIdleCallback.js +5 -5
- package/dist/esm/internal/requestIdleCallback.js.map +1 -1
- package/dist/esm/internal/share.js +12 -12
- package/dist/esm/internal/share.js.map +1 -1
- package/dist/esm/internal/sync-operator.js +49 -21
- package/dist/esm/internal/sync-operator.js.map +1 -1
- package/dist/esm/internal/sync-producer.js +88 -0
- package/dist/esm/internal/sync-producer.js.map +1 -0
- package/dist/esm/internal/withKey.js +46 -47
- package/dist/esm/internal/withKey.js.map +1 -1
- package/package.json +22 -62
- package/src/AsyncData.ts +447 -0
- package/src/Emitter.ts +47 -38
- package/src/Form.ts +185 -65
- package/src/FormEntry.ts +142 -109
- package/src/Fx.ts +1685 -1851
- package/src/Guard.ts +12 -1
- package/src/Idle.ts +76 -62
- package/src/Match.ts +149 -93
- package/src/Pull.ts +8 -8
- package/src/Push.ts +472 -0
- package/src/RefArray.ts +53 -51
- package/src/RefChunk.ts +44 -41
- package/src/RefHashMap.ts +57 -43
- package/src/RefHashSet.ts +21 -31
- package/src/RefSubject.ts +1984 -457
- package/src/Sink.ts +922 -171
- package/src/Stream.ts +32 -20
- package/src/Subject.ts +230 -87
- package/src/TypeId.ts +16 -4
- package/src/Typeclass.ts +31 -32
- package/src/Versioned.ts +220 -168
- package/src/index.ts +78 -6
- package/src/internal/DeferredRef.ts +62 -0
- package/src/internal/UnionToTuple.ts +11 -0
- package/src/internal/core.ts +2491 -1950
- package/src/internal/diff.ts +157 -0
- package/src/internal/effect-loop-operator.ts +466 -0
- package/src/internal/effect-operator.ts +89 -54
- package/src/internal/effect-producer.ts +125 -0
- package/src/internal/helpers.ts +275 -205
- package/src/internal/keyed.ts +192 -241
- package/src/internal/loop-operator.ts +266 -0
- package/src/internal/operator.ts +87 -0
- package/src/internal/protos.ts +29 -104
- package/src/internal/provide.ts +48 -40
- package/src/internal/requestIdleCallback.ts +5 -6
- package/src/internal/share.ts +26 -24
- package/src/internal/sync-operator.ts +68 -27
- package/src/internal/sync-producer.ts +146 -0
- package/src/internal/withKey.ts +64 -74
- package/dist/cjs/Computed.js +0 -115
- package/dist/cjs/Computed.js.map +0 -1
- package/dist/cjs/Filtered.js +0 -95
- package/dist/cjs/Filtered.js.map +0 -1
- package/dist/cjs/Model.js +0 -119
- package/dist/cjs/Model.js.map +0 -1
- package/dist/cjs/RefAsyncData.js +0 -187
- package/dist/cjs/RefAsyncData.js.map +0 -1
- package/dist/cjs/RefAsyncDataArray.js +0 -38
- package/dist/cjs/RefAsyncDataArray.js.map +0 -1
- package/dist/cjs/RefBoolean.js +0 -45
- package/dist/cjs/RefBoolean.js.map +0 -1
- package/dist/cjs/RefNumber.js +0 -49
- package/dist/cjs/RefNumber.js.map +0 -1
- package/dist/cjs/internal/core-ref-subject.js +0 -254
- package/dist/cjs/internal/core-ref-subject.js.map +0 -1
- package/dist/cjs/internal/core-subject.js +0 -108
- package/dist/cjs/internal/core-subject.js.map +0 -1
- package/dist/cjs/internal/deferred-ref.js.map +0 -1
- package/dist/cjs/internal/effect-primitive.js +0 -47
- package/dist/cjs/internal/effect-primitive.js.map +0 -1
- package/dist/cjs/internal/fx-effect-proto.js +0 -58
- package/dist/cjs/internal/fx-effect-proto.js.map +0 -1
- package/dist/cjs/internal/fx-primitive.js +0 -193
- package/dist/cjs/internal/fx-primitive.js.map +0 -1
- package/dist/cjs/internal/fx.js +0 -240
- package/dist/cjs/internal/fx.js.map +0 -1
- package/dist/cjs/internal/matchers.js +0 -34
- package/dist/cjs/internal/matchers.js.map +0 -1
- package/dist/cjs/internal/run.js +0 -54
- package/dist/cjs/internal/run.js.map +0 -1
- package/dist/cjs/internal/schema-ref-subject.js +0 -132
- package/dist/cjs/internal/schema-ref-subject.js.map +0 -1
- package/dist/cjs/internal/versioned-transform.js +0 -46
- package/dist/cjs/internal/versioned-transform.js.map +0 -1
- package/dist/dts/Computed.d.ts +0 -106
- package/dist/dts/Computed.d.ts.map +0 -1
- package/dist/dts/Filtered.d.ts +0 -97
- package/dist/dts/Filtered.d.ts.map +0 -1
- package/dist/dts/Model.d.ts +0 -200
- package/dist/dts/Model.d.ts.map +0 -1
- package/dist/dts/RefAsyncData.d.ts +0 -236
- package/dist/dts/RefAsyncData.d.ts.map +0 -1
- package/dist/dts/RefAsyncDataArray.d.ts +0 -56
- package/dist/dts/RefAsyncDataArray.d.ts.map +0 -1
- package/dist/dts/RefBoolean.d.ts +0 -47
- package/dist/dts/RefBoolean.d.ts.map +0 -1
- package/dist/dts/RefNumber.d.ts +0 -48
- package/dist/dts/RefNumber.d.ts.map +0 -1
- package/dist/dts/internal/core-ref-subject.d.ts +0 -100
- package/dist/dts/internal/core-ref-subject.d.ts.map +0 -1
- package/dist/dts/internal/core-subject.d.ts +0 -5
- package/dist/dts/internal/core-subject.d.ts.map +0 -1
- package/dist/dts/internal/deferred-ref.d.ts +0 -12
- package/dist/dts/internal/deferred-ref.d.ts.map +0 -1
- package/dist/dts/internal/effect-primitive.d.ts +0 -6
- package/dist/dts/internal/effect-primitive.d.ts.map +0 -1
- package/dist/dts/internal/fx-effect-proto.d.ts +0 -30
- package/dist/dts/internal/fx-effect-proto.d.ts.map +0 -1
- package/dist/dts/internal/fx-primitive.d.ts +0 -109
- package/dist/dts/internal/fx-primitive.d.ts.map +0 -1
- package/dist/dts/internal/fx.d.ts +0 -245
- package/dist/dts/internal/fx.d.ts.map +0 -1
- package/dist/dts/internal/matchers.d.ts +0 -33
- package/dist/dts/internal/matchers.d.ts.map +0 -1
- package/dist/dts/internal/run.d.ts +0 -8
- package/dist/dts/internal/run.d.ts.map +0 -1
- package/dist/dts/internal/schema-ref-subject.d.ts +0 -5
- package/dist/dts/internal/schema-ref-subject.d.ts.map +0 -1
- package/dist/dts/internal/versioned-transform.d.ts +0 -17
- package/dist/dts/internal/versioned-transform.d.ts.map +0 -1
- package/dist/esm/Computed.js +0 -103
- package/dist/esm/Computed.js.map +0 -1
- package/dist/esm/Filtered.js +0 -83
- package/dist/esm/Filtered.js.map +0 -1
- package/dist/esm/Model.js +0 -100
- package/dist/esm/Model.js.map +0 -1
- package/dist/esm/RefAsyncData.js +0 -163
- package/dist/esm/RefAsyncData.js.map +0 -1
- package/dist/esm/RefAsyncDataArray.js +0 -27
- package/dist/esm/RefAsyncDataArray.js.map +0 -1
- package/dist/esm/RefBoolean.js +0 -31
- package/dist/esm/RefBoolean.js.map +0 -1
- package/dist/esm/RefNumber.js +0 -35
- package/dist/esm/RefNumber.js.map +0 -1
- package/dist/esm/internal/core-ref-subject.js +0 -242
- package/dist/esm/internal/core-ref-subject.js.map +0 -1
- package/dist/esm/internal/core-subject.js +0 -90
- package/dist/esm/internal/core-subject.js.map +0 -1
- package/dist/esm/internal/deferred-ref.js +0 -23
- package/dist/esm/internal/deferred-ref.js.map +0 -1
- package/dist/esm/internal/effect-primitive.js +0 -41
- package/dist/esm/internal/effect-primitive.js.map +0 -1
- package/dist/esm/internal/fx-effect-proto.js +0 -43
- package/dist/esm/internal/fx-effect-proto.js.map +0 -1
- package/dist/esm/internal/fx-primitive.js +0 -175
- package/dist/esm/internal/fx-primitive.js.map +0 -1
- package/dist/esm/internal/fx.js +0 -216
- package/dist/esm/internal/fx.js.map +0 -1
- package/dist/esm/internal/matchers.js +0 -38
- package/dist/esm/internal/matchers.js.map +0 -1
- package/dist/esm/internal/run.js +0 -32
- package/dist/esm/internal/run.js.map +0 -1
- package/dist/esm/internal/schema-ref-subject.js +0 -121
- package/dist/esm/internal/schema-ref-subject.js.map +0 -1
- package/dist/esm/internal/versioned-transform.js +0 -37
- package/dist/esm/internal/versioned-transform.js.map +0 -1
- package/src/Computed.ts +0 -289
- package/src/Filtered.ts +0 -274
- package/src/Model.ts +0 -483
- package/src/RefAsyncData.ts +0 -547
- package/src/RefAsyncDataArray.ts +0 -135
- package/src/RefBoolean.ts +0 -71
- package/src/RefNumber.ts +0 -77
- package/src/internal/core-ref-subject.ts +0 -528
- package/src/internal/core-subject.ts +0 -143
- package/src/internal/deferred-ref.ts +0 -26
- package/src/internal/effect-primitive.ts +0 -230
- package/src/internal/fx-effect-proto.ts +0 -56
- package/src/internal/fx-primitive.ts +0 -223
- package/src/internal/fx.ts +0 -619
- package/src/internal/matchers.ts +0 -83
- package/src/internal/run.ts +0 -51
- package/src/internal/schema-ref-subject.ts +0 -163
- package/src/internal/versioned-transform.ts +0 -48
package/dist/esm/Fx.js
CHANGED
|
@@ -1,1259 +1,760 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fx
|
|
3
|
-
*
|
|
4
|
-
* and succeed with an `A`.
|
|
5
|
-
*
|
|
6
|
-
* Any `Fx`, shorthand for "Effects", can emit 0 or more errors or events over an
|
|
7
|
-
* indefinite period of time. This is in contrast to `Effect` which can only
|
|
8
|
-
* produce exactly 1 error or event.
|
|
9
|
-
*
|
|
10
|
-
* It is defined as a super-type of `Effect`, `Stream`, and `Cause`. This
|
|
11
|
-
* allows for all operators that accept an `Fx` to also capable of
|
|
12
|
-
* accepting an `Effect`, `Stream`, or `Cause`. An Effect or Cause represents a single
|
|
13
|
-
* event or error, while a Stream represents a series of events or errors that will
|
|
14
|
-
* be pulled from the producer as soon as possible.
|
|
15
|
-
*
|
|
16
|
-
* @since 1.18.0
|
|
2
|
+
* Fx is a push-based reactive primitive built atop of Effect.
|
|
3
|
+
* @since 1.20.0
|
|
17
4
|
*/
|
|
18
5
|
import * as Cause from "effect/Cause";
|
|
19
6
|
import * as Effect from "effect/Effect";
|
|
20
7
|
import * as Either from "effect/Either";
|
|
21
|
-
import {
|
|
8
|
+
import { dual, identity } from "effect/Function";
|
|
9
|
+
import * as Layer from "effect/Layer";
|
|
22
10
|
import * as Option from "effect/Option";
|
|
11
|
+
import { hasProperty } from "effect/Predicate";
|
|
12
|
+
import * as Queue from "effect/Queue";
|
|
13
|
+
import * as Schedule from "effect/Schedule";
|
|
14
|
+
import * as Emitter from "./Emitter.js";
|
|
23
15
|
import * as core from "./internal/core.js";
|
|
24
|
-
import * as
|
|
25
|
-
import * as
|
|
26
|
-
import * as
|
|
27
|
-
import * as internalProtos from "./internal/protos.js";
|
|
28
|
-
import * as internalRun from "./internal/run.js";
|
|
29
|
-
import * as Share from "./internal/share.js";
|
|
16
|
+
import * as coreKeyed from "./internal/keyed.js";
|
|
17
|
+
import * as protos from "./internal/protos.js";
|
|
18
|
+
import * as coreShare from "./internal/share.js";
|
|
30
19
|
import * as strategies from "./internal/strategies.js";
|
|
31
|
-
import * as
|
|
20
|
+
import * as coreWithKey from "./internal/withKey.js";
|
|
32
21
|
import { transform } from "./RefSubject.js";
|
|
22
|
+
import * as Sink from "./Sink.js";
|
|
33
23
|
import { TypeId } from "./TypeId.js";
|
|
24
|
+
/**
|
|
25
|
+
* @since 1.20.0
|
|
26
|
+
*/
|
|
27
|
+
export function isFx(u) {
|
|
28
|
+
return u === null ? false : hasProperty(u, TypeId);
|
|
29
|
+
}
|
|
34
30
|
/**
|
|
35
31
|
* Singleton instance of Unbounded
|
|
36
|
-
* @since 1.
|
|
32
|
+
* @since 1.20.0
|
|
37
33
|
* @category FlattenStrategy
|
|
38
34
|
*/
|
|
39
35
|
export const Unbounded = strategies.Unbounded;
|
|
40
36
|
/**
|
|
41
37
|
* Construct a Bounded strategy
|
|
42
|
-
* @since 1.
|
|
38
|
+
* @since 1.20.0
|
|
43
39
|
* @category FlattenStrategy
|
|
44
40
|
*/
|
|
45
41
|
export const Bounded = strategies.Bounded;
|
|
46
42
|
/**
|
|
47
43
|
* Singleton instance of Switch
|
|
48
|
-
* @since 1.
|
|
44
|
+
* @since 1.20.0
|
|
49
45
|
* @category FlattenStrategy
|
|
50
46
|
*/
|
|
51
47
|
export const Switch = strategies.Switch;
|
|
52
48
|
/**
|
|
53
49
|
* Singleton instance of Exhaust
|
|
54
|
-
* @since 1.
|
|
50
|
+
* @since 1.20.0
|
|
55
51
|
* @category FlattenStrategy
|
|
56
52
|
*/
|
|
57
53
|
export const Exhaust = strategies.Exhaust;
|
|
58
54
|
/**
|
|
59
55
|
* Singleton instance of ExhaustLatest
|
|
60
|
-
* @since 1.
|
|
56
|
+
* @since 1.20.0
|
|
61
57
|
* @category FlattenStrategy
|
|
62
58
|
*/
|
|
63
59
|
export const ExhaustLatest = strategies.ExhaustLatest;
|
|
64
60
|
/**
|
|
65
61
|
* Construct an Unordered strategy
|
|
66
|
-
* @since 1.
|
|
62
|
+
* @since 1.20.0
|
|
67
63
|
* @category MergeStrategy
|
|
68
64
|
*/
|
|
69
65
|
export const Unordered = strategies.Unordered;
|
|
70
66
|
/**
|
|
71
67
|
* Construct an Ordered strategy
|
|
72
|
-
* @since 1.
|
|
68
|
+
* @since 1.20.0
|
|
73
69
|
* @category MergeStrategy
|
|
74
70
|
*/
|
|
75
71
|
export const Ordered = strategies.Ordered;
|
|
76
|
-
/* #endregion */
|
|
77
|
-
/* #region Constructor */
|
|
78
|
-
/* #region Core */
|
|
79
72
|
/**
|
|
80
|
-
*
|
|
81
|
-
* @since 1.18.0
|
|
82
|
-
* @category constructors
|
|
73
|
+
* @since 1.20.0
|
|
83
74
|
*/
|
|
84
|
-
export const
|
|
75
|
+
export const make = core.make;
|
|
85
76
|
/**
|
|
86
|
-
*
|
|
87
|
-
* @since 1.18.0
|
|
88
|
-
* @category constructors
|
|
77
|
+
* @since 1.20.0
|
|
89
78
|
*/
|
|
90
|
-
export const
|
|
79
|
+
export const succeed = core.succeed;
|
|
91
80
|
/**
|
|
92
|
-
*
|
|
93
|
-
* @since 1.18.0
|
|
94
|
-
* @category constructors
|
|
81
|
+
* @since 1.20.0
|
|
95
82
|
*/
|
|
96
|
-
export const
|
|
83
|
+
export const sync = core.fromSync;
|
|
97
84
|
/**
|
|
98
|
-
*
|
|
99
|
-
* @since 1.18.0
|
|
100
|
-
* @category constructors
|
|
85
|
+
* @since 1.20.0
|
|
101
86
|
*/
|
|
102
|
-
export const
|
|
87
|
+
export const fromArray = core.fromArray;
|
|
103
88
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @since 1.18.0
|
|
106
|
-
* @category constructors
|
|
89
|
+
* @since 1.20.0
|
|
107
90
|
*/
|
|
108
|
-
export const
|
|
91
|
+
export const fromIterable = core.fromIterable;
|
|
109
92
|
/**
|
|
110
|
-
*
|
|
111
|
-
* @since 1.18.0
|
|
112
|
-
* @category constructors
|
|
93
|
+
* @since 1.20.0
|
|
113
94
|
*/
|
|
114
95
|
export const fromEffect = core.fromEffect;
|
|
115
96
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @since 1.18.0
|
|
118
|
-
* @category constructors
|
|
97
|
+
* @since 1.20.0
|
|
119
98
|
*/
|
|
120
|
-
export const
|
|
99
|
+
export const fromScheduled = dual(2, core.fromScheduled);
|
|
121
100
|
/**
|
|
122
|
-
*
|
|
123
|
-
* @since 1.18.0
|
|
124
|
-
* @category constructors
|
|
101
|
+
* @since 1.20.0
|
|
125
102
|
*/
|
|
126
|
-
export const
|
|
103
|
+
export const schedule = dual(2, core.schedule);
|
|
127
104
|
/**
|
|
128
|
-
*
|
|
129
|
-
* @since 1.18.0
|
|
130
|
-
* @category constructors
|
|
105
|
+
* @since 1.20.0
|
|
131
106
|
*/
|
|
132
|
-
export const
|
|
107
|
+
export const periodic = dual(2, (iterator, period) => continueWith(fromEffect(iterator), () => schedule(iterator, Schedule.spaced(period))));
|
|
133
108
|
/**
|
|
134
|
-
*
|
|
135
|
-
* to emit events and errors.
|
|
136
|
-
* @since 1.18.0
|
|
137
|
-
* @category constructors
|
|
109
|
+
* @since 1.20.0
|
|
138
110
|
*/
|
|
139
|
-
export const
|
|
111
|
+
export const failCause = core.failCause;
|
|
140
112
|
/**
|
|
141
|
-
*
|
|
142
|
-
* to emit events and errors.
|
|
143
|
-
* @since 1.18.0
|
|
144
|
-
* @category constructors
|
|
113
|
+
* @since 1.20.0
|
|
145
114
|
*/
|
|
146
|
-
export const
|
|
115
|
+
export const fail = core.fail;
|
|
147
116
|
/**
|
|
148
|
-
*
|
|
149
|
-
* @since 1.18.0
|
|
150
|
-
* @category constructors
|
|
117
|
+
* @since 1.20.0
|
|
151
118
|
*/
|
|
152
|
-
export const
|
|
119
|
+
export const die = core.die;
|
|
153
120
|
/**
|
|
154
|
-
*
|
|
155
|
-
* @since 1.18.0
|
|
156
|
-
* @category constructors
|
|
121
|
+
* @since 1.20.0
|
|
157
122
|
*/
|
|
158
|
-
export const
|
|
123
|
+
export const map = dual(2, core.map);
|
|
159
124
|
/**
|
|
160
|
-
*
|
|
161
|
-
* @since 1.18.0
|
|
162
|
-
* @category constructors
|
|
125
|
+
* @since 1.20.0
|
|
163
126
|
*/
|
|
164
|
-
export const
|
|
127
|
+
export const filter = dual(2, core.filter);
|
|
165
128
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @since 1.18.0
|
|
168
|
-
* @category constructors
|
|
129
|
+
* @since 1.20.0
|
|
169
130
|
*/
|
|
170
|
-
export const
|
|
131
|
+
export const filterMap = dual(2, core.filterMap);
|
|
171
132
|
/**
|
|
172
|
-
*
|
|
173
|
-
* @since 1.18.0
|
|
174
|
-
* @category Subtyping
|
|
133
|
+
* @since 1.20.0
|
|
175
134
|
*/
|
|
176
|
-
export
|
|
177
|
-
}
|
|
135
|
+
export const compact = (fx) => filterMap(fx, identity);
|
|
178
136
|
/**
|
|
179
|
-
*
|
|
180
|
-
* @since 1.18.0
|
|
181
|
-
* @category constructors
|
|
137
|
+
* @since 1.20.0
|
|
182
138
|
*/
|
|
183
|
-
export const
|
|
139
|
+
export const mapEffect = dual(2, core.mapEffect);
|
|
184
140
|
/**
|
|
185
|
-
*
|
|
186
|
-
* @since 1.18.0
|
|
187
|
-
* @category constructors
|
|
141
|
+
* @since 1.20.0
|
|
188
142
|
*/
|
|
189
|
-
export const
|
|
143
|
+
export const filterMapEffect = dual(2, core.filterMapEffect);
|
|
190
144
|
/**
|
|
191
|
-
*
|
|
192
|
-
* @since 1.18.0
|
|
193
|
-
* @category constructors
|
|
145
|
+
* @since 1.20.0
|
|
194
146
|
*/
|
|
195
|
-
export const
|
|
147
|
+
export const filterEffect = dual(2, core.filterEffect);
|
|
196
148
|
/**
|
|
197
|
-
*
|
|
198
|
-
* @since 1.18.0
|
|
199
|
-
* @category constructors
|
|
149
|
+
* @since 1.20.0
|
|
200
150
|
*/
|
|
201
|
-
export const
|
|
202
|
-
/* #endregion */
|
|
203
|
-
/* #region Additions */
|
|
151
|
+
export const tapEffect = dual(2, core.tapEffect);
|
|
204
152
|
/**
|
|
205
|
-
*
|
|
206
|
-
* after the Fx has exited.
|
|
207
|
-
*
|
|
208
|
-
* @since 1.18.0
|
|
209
|
-
* @category constructors
|
|
153
|
+
* @since 1.20.0
|
|
210
154
|
*/
|
|
211
|
-
export const
|
|
155
|
+
export const tap = dual(2, (fx, f) => tapEffect(fx, (a) => Effect.sync(() => f(a))));
|
|
212
156
|
/**
|
|
213
|
-
*
|
|
214
|
-
* as a tuple of values.
|
|
215
|
-
*
|
|
216
|
-
* @since 1.18.0
|
|
217
|
-
* @category constructors
|
|
157
|
+
* @since 1.20.0
|
|
218
158
|
*/
|
|
219
|
-
export const
|
|
159
|
+
export const loop = dual(3, core.loop);
|
|
220
160
|
/**
|
|
221
|
-
*
|
|
222
|
-
* as a record of values.
|
|
223
|
-
*
|
|
224
|
-
* @since 1.18.0
|
|
225
|
-
* @category constructors
|
|
161
|
+
* @since 1.20.0
|
|
226
162
|
*/
|
|
227
|
-
export const
|
|
163
|
+
export const filterMapLoop = dual(3, core.filterMapLoop);
|
|
228
164
|
/**
|
|
229
|
-
*
|
|
230
|
-
* as they occur.
|
|
231
|
-
* @since 1.18.0
|
|
232
|
-
* @category constructors
|
|
165
|
+
* @since 1.20.0
|
|
233
166
|
*/
|
|
234
|
-
export const
|
|
167
|
+
export const loopEffect = dual(3, core.loopEffect);
|
|
235
168
|
/**
|
|
236
|
-
*
|
|
237
|
-
* as they occur, but only allowing `n` concurrent Fx to run at a time.
|
|
238
|
-
*
|
|
239
|
-
* @since 1.18.0
|
|
240
|
-
* @category constructors
|
|
169
|
+
* @since 1.20.0
|
|
241
170
|
*/
|
|
242
|
-
export const
|
|
171
|
+
export const filterMapLoopEffect = dual(3, core.filterMapLoopEffect);
|
|
243
172
|
/**
|
|
244
|
-
*
|
|
245
|
-
* in the order the Fx were provided. All Fx will be executed concurrently,
|
|
246
|
-
* and the results will be buffered if necessary to preserve ordering.
|
|
247
|
-
*
|
|
248
|
-
* @since 1.18.0
|
|
249
|
-
* @category constructors
|
|
173
|
+
* @since 1.20.0
|
|
250
174
|
*/
|
|
251
|
-
export const
|
|
175
|
+
export const observe = dual(2, core.observe);
|
|
252
176
|
/**
|
|
253
|
-
*
|
|
254
|
-
* in the order the Fx were provided. All Fx will be executed concurrently, limited
|
|
255
|
-
* by the provided concurrency, and the results will be buffered if necessary to preserve ordering.
|
|
256
|
-
*
|
|
257
|
-
* @since 1.18.0
|
|
258
|
-
* @category constructors
|
|
177
|
+
* @since 1.20.0
|
|
259
178
|
*/
|
|
260
|
-
export const
|
|
179
|
+
export const drain = core.drain;
|
|
261
180
|
/**
|
|
262
|
-
*
|
|
263
|
-
* allowing only 1 Fx to run at a time.
|
|
264
|
-
*
|
|
265
|
-
* @since 1.18.0
|
|
266
|
-
* @category constructors
|
|
181
|
+
* @since 1.20.0
|
|
267
182
|
*/
|
|
268
|
-
export const
|
|
183
|
+
export const reduce = dual(3, core.reduce);
|
|
269
184
|
/**
|
|
270
|
-
*
|
|
271
|
-
* first Fx to emit a value.
|
|
272
|
-
*
|
|
273
|
-
* @since 1.18.0
|
|
274
|
-
* @category constructors
|
|
185
|
+
* @since 1.20.0
|
|
275
186
|
*/
|
|
276
|
-
export const
|
|
187
|
+
export const toReadonlyArray = core.toReadonlyArray;
|
|
277
188
|
/**
|
|
278
|
-
*
|
|
279
|
-
* at the intervals specified by the Schedule.
|
|
280
|
-
*
|
|
281
|
-
* @since 1.18.0
|
|
282
|
-
* @category constructors
|
|
189
|
+
* @since 1.20.0
|
|
283
190
|
*/
|
|
284
|
-
export const
|
|
191
|
+
export const slice = dual(3, core.slice);
|
|
285
192
|
/**
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* @since 1.18.0
|
|
289
|
-
* @category constructors
|
|
193
|
+
* @since 1.20.0
|
|
290
194
|
*/
|
|
291
|
-
export const
|
|
195
|
+
export const take = dual(2, core.take);
|
|
292
196
|
/**
|
|
293
|
-
*
|
|
294
|
-
* @since 1.18.0
|
|
295
|
-
* @category constructors
|
|
197
|
+
* @since 1.20.0
|
|
296
198
|
*/
|
|
297
|
-
export const
|
|
199
|
+
export const drop = dual(2, core.drop);
|
|
298
200
|
/**
|
|
299
|
-
*
|
|
300
|
-
* @since 1.18.0
|
|
301
|
-
* @category constructors
|
|
201
|
+
* @since 1.20.0
|
|
302
202
|
*/
|
|
303
|
-
export const
|
|
304
|
-
/* #endregion */
|
|
305
|
-
/* #region Running */
|
|
203
|
+
export const skipRepeats = core.skipRepeats;
|
|
306
204
|
/**
|
|
307
|
-
*
|
|
308
|
-
* Effect will resolve with the first Error of the Fx.
|
|
309
|
-
* @since 1.18.0
|
|
310
|
-
* @category running
|
|
205
|
+
* @since 1.20.0
|
|
311
206
|
*/
|
|
312
|
-
export const
|
|
207
|
+
export const skipRepeatsWith = dual(2, core.skipRepeatsWith);
|
|
313
208
|
/**
|
|
314
|
-
*
|
|
315
|
-
* Effect will resolve with the first Error of the Fx.
|
|
316
|
-
*
|
|
317
|
-
* @since 1.18.0
|
|
318
|
-
* @category running
|
|
209
|
+
* @since 1.20.0
|
|
319
210
|
*/
|
|
320
|
-
export const
|
|
211
|
+
export const empty = core.empty;
|
|
321
212
|
/**
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* @since 1.18.0
|
|
325
|
-
* @category running
|
|
213
|
+
* @since 1.20.0
|
|
326
214
|
*/
|
|
327
|
-
export const
|
|
215
|
+
export const never = core.never;
|
|
328
216
|
/**
|
|
329
|
-
*
|
|
330
|
-
* @since 1.18.0
|
|
331
|
-
* @category running
|
|
217
|
+
* @since 1.20.0
|
|
332
218
|
*/
|
|
333
|
-
export const
|
|
219
|
+
export const padWith = dual(3, core.padWith);
|
|
334
220
|
/**
|
|
335
|
-
*
|
|
336
|
-
* @since 1.18.0
|
|
337
|
-
* @category running
|
|
221
|
+
* @since 1.20.0
|
|
338
222
|
*/
|
|
339
|
-
export const
|
|
223
|
+
export const prependAll = dual(2, core.prependAll);
|
|
340
224
|
/**
|
|
341
|
-
*
|
|
342
|
-
* @since 1.18.0
|
|
343
|
-
* @category running
|
|
225
|
+
* @since 1.20.0
|
|
344
226
|
*/
|
|
345
|
-
export const
|
|
227
|
+
export const appendAll = dual(2, core.appendAll);
|
|
346
228
|
/**
|
|
347
|
-
*
|
|
348
|
-
* @since 1.18.0
|
|
349
|
-
* @category running
|
|
229
|
+
* @since 1.20.0
|
|
350
230
|
*/
|
|
351
|
-
export const
|
|
231
|
+
export const prepend = dual(2, core.prepend);
|
|
352
232
|
/**
|
|
353
|
-
*
|
|
354
|
-
* @since 1.18.0
|
|
355
|
-
* @category running
|
|
233
|
+
* @since 1.20.0
|
|
356
234
|
*/
|
|
357
|
-
export const
|
|
358
|
-
/* #endregion */
|
|
359
|
-
/* #region Combinators */
|
|
235
|
+
export const append = dual(2, core.append);
|
|
360
236
|
/**
|
|
361
|
-
*
|
|
362
|
-
* @since 1.18.0
|
|
363
|
-
* @category combinators
|
|
237
|
+
* @since 1.20.0
|
|
364
238
|
*/
|
|
365
|
-
export const
|
|
239
|
+
export const scan = dual(3, core.scan);
|
|
366
240
|
/**
|
|
367
|
-
*
|
|
368
|
-
* @since 1.18.0
|
|
369
|
-
* @category combinators
|
|
241
|
+
* @since 1.20.0
|
|
370
242
|
*/
|
|
371
|
-
export const
|
|
243
|
+
export const flatMapWithStrategy = dual(4, core.flatMapWithStrategy);
|
|
244
|
+
const isDataFirstFx = (args) => isFx(args[0]);
|
|
372
245
|
/**
|
|
373
|
-
*
|
|
374
|
-
* @since 1.18.0
|
|
375
|
-
* @category combinators
|
|
246
|
+
* @since 1.20.0
|
|
376
247
|
*/
|
|
377
|
-
export const
|
|
248
|
+
export const flatMap = dual(isDataFirstFx, core.flatMap);
|
|
378
249
|
/**
|
|
379
|
-
*
|
|
380
|
-
* @since 1.18.0
|
|
381
|
-
* @category combinators
|
|
250
|
+
* @since 1.20.0
|
|
382
251
|
*/
|
|
383
|
-
export const
|
|
252
|
+
export const flatMapEffect = dual(isDataFirstFx, core.flatMapEffect);
|
|
384
253
|
/**
|
|
385
|
-
*
|
|
386
|
-
* @since 1.18.0
|
|
387
|
-
* @category combinators
|
|
254
|
+
* @since 1.20.0
|
|
388
255
|
*/
|
|
389
|
-
export const
|
|
256
|
+
export const switchMap = dual(isDataFirstFx, core.switchMap);
|
|
390
257
|
/**
|
|
391
|
-
*
|
|
392
|
-
* @since 1.18.0
|
|
393
|
-
* @category errors
|
|
258
|
+
* @since 1.20.0
|
|
394
259
|
*/
|
|
395
|
-
export const
|
|
260
|
+
export const switchMapEffect = dual(isDataFirstFx, core.switchMapEffect);
|
|
396
261
|
/**
|
|
397
|
-
*
|
|
398
|
-
* @since 1.18.0
|
|
399
|
-
* @category errors
|
|
262
|
+
* @since 1.20.0
|
|
400
263
|
*/
|
|
401
|
-
export const
|
|
264
|
+
export const exhaustMap = dual(isDataFirstFx, core.exhaustMap);
|
|
402
265
|
/**
|
|
403
|
-
*
|
|
404
|
-
* @since 1.18.0
|
|
405
|
-
* @category errors
|
|
266
|
+
* @since 1.20.0
|
|
406
267
|
*/
|
|
407
|
-
export const
|
|
268
|
+
export const exhaustMapEffect = dual(isDataFirstFx, core.exhaustMapEffect);
|
|
408
269
|
/**
|
|
409
|
-
*
|
|
410
|
-
* @since 1.18.0
|
|
411
|
-
* @category errors
|
|
270
|
+
* @since 1.20.0
|
|
412
271
|
*/
|
|
413
|
-
export const
|
|
272
|
+
export const exhaustMapLatest = dual(isDataFirstFx, core.exhaustMapLatest);
|
|
414
273
|
/**
|
|
415
|
-
*
|
|
416
|
-
* @since 1.18.0
|
|
417
|
-
* @category errors
|
|
274
|
+
* @since 1.20.0
|
|
418
275
|
*/
|
|
419
|
-
export const
|
|
276
|
+
export const exhaustMapLatestEffect = dual(isDataFirstFx, core.exhaustMapLatestEffect);
|
|
420
277
|
/**
|
|
421
|
-
*
|
|
422
|
-
* @since 1.18.0
|
|
423
|
-
* @category errors
|
|
278
|
+
* @since 1.20.0
|
|
424
279
|
*/
|
|
425
|
-
export const
|
|
280
|
+
export const flatMapConcurrently = dual(isDataFirstFx, core.flatMapConcurrently);
|
|
426
281
|
/**
|
|
427
|
-
*
|
|
428
|
-
* @since 1.18.0
|
|
429
|
-
* @category errors
|
|
282
|
+
* @since 1.20.0
|
|
430
283
|
*/
|
|
431
|
-
export const
|
|
284
|
+
export const flatMapConcurrentlyEffect = dual(isDataFirstFx, core.flatMapConcurrentlyEffect);
|
|
432
285
|
/**
|
|
433
|
-
*
|
|
434
|
-
* with the provided FlattenStrategy.
|
|
435
|
-
* @since 1.18.0
|
|
436
|
-
* @category flattening
|
|
286
|
+
* @since 1.20.0
|
|
437
287
|
*/
|
|
438
|
-
export const
|
|
288
|
+
export const concatMap = dual(isDataFirstFx, core.concatMap);
|
|
439
289
|
/**
|
|
440
|
-
*
|
|
441
|
-
* Fx emitted and interrupting the previous.
|
|
442
|
-
* @since 1.18.0
|
|
443
|
-
* @category flattening
|
|
290
|
+
* @since 1.20.0
|
|
444
291
|
*/
|
|
445
|
-
export const
|
|
292
|
+
export const fromFxEffect = core.fromFxEffect;
|
|
446
293
|
/**
|
|
447
|
-
*
|
|
448
|
-
* Fx emitted and interrupting the previous.
|
|
449
|
-
* @since 1.18.0
|
|
450
|
-
* @category flattening
|
|
294
|
+
* @since 1.20.0
|
|
451
295
|
*/
|
|
452
|
-
export const
|
|
296
|
+
export const continueWith = dual(2, core.continueWith);
|
|
453
297
|
/**
|
|
454
|
-
*
|
|
455
|
-
* Fx emitted and dropping any subsequent Fx until it has completed.
|
|
456
|
-
* @since 1.18.0
|
|
457
|
-
* @category flattening
|
|
298
|
+
* @since 1.20.0
|
|
458
299
|
*/
|
|
459
|
-
export const
|
|
300
|
+
export const orElseCause = dual(2, core.orElseCause);
|
|
460
301
|
/**
|
|
461
|
-
*
|
|
462
|
-
* Fx emitted and dropping any subsequent Fx until it has completed.
|
|
463
|
-
* @since 1.18.0
|
|
464
|
-
* @category flattening
|
|
302
|
+
* @since 1.20.0
|
|
465
303
|
*/
|
|
466
|
-
export const
|
|
304
|
+
export const orElse = dual(2, core.orElse);
|
|
467
305
|
/**
|
|
468
|
-
*
|
|
469
|
-
* until completion, and then running the last emitted Fx if they are not
|
|
470
|
-
* the same Fx.
|
|
471
|
-
*
|
|
472
|
-
* @since 1.18.0
|
|
473
|
-
* @category flattening
|
|
306
|
+
* @since 1.20.0
|
|
474
307
|
*/
|
|
475
|
-
export const
|
|
308
|
+
export const suspend = core.suspend;
|
|
476
309
|
/**
|
|
477
|
-
*
|
|
478
|
-
* the same Fx.
|
|
479
|
-
*
|
|
480
|
-
* @since 1.18.0
|
|
481
|
-
* @category flattening
|
|
310
|
+
* @since 1.20.0
|
|
482
311
|
*/
|
|
483
|
-
export const
|
|
312
|
+
export const mergeWithStrategy = dual(2, core.mergeWithStrategy);
|
|
484
313
|
/**
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
* @since 1.18.0
|
|
488
|
-
* @category flattening
|
|
314
|
+
* @since 1.20.0
|
|
489
315
|
*/
|
|
490
|
-
export const
|
|
316
|
+
export const merge = dual(2, core.merge);
|
|
491
317
|
/**
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
* @since 1.18.0
|
|
495
|
-
* @category flattening
|
|
318
|
+
* @since 1.20.0
|
|
496
319
|
*/
|
|
497
|
-
export const
|
|
320
|
+
export const mergeAll = core.mergeAll;
|
|
498
321
|
/**
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
* @since 1.18.0
|
|
502
|
-
* @category flattening
|
|
322
|
+
* @since 1.20.0
|
|
503
323
|
*/
|
|
504
|
-
export const
|
|
324
|
+
export const mergeOrdered = core.mergeOrdered;
|
|
505
325
|
/**
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
* @since 1.18.0
|
|
509
|
-
* @category flattening
|
|
326
|
+
* @since 1.20.0
|
|
510
327
|
*/
|
|
511
|
-
export const
|
|
328
|
+
export const mergeOrderedConcurrently = core.mergeOrderedConcurrently;
|
|
512
329
|
/**
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
* @since 1.18.0
|
|
516
|
-
* @category slicing
|
|
330
|
+
* @since 1.20.0
|
|
517
331
|
*/
|
|
518
|
-
export const
|
|
332
|
+
export const mergeSwitch = core.mergeSwitch;
|
|
519
333
|
/**
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
* @since 1.18.0
|
|
523
|
-
* @category slicing
|
|
334
|
+
* @since 1.20.0
|
|
524
335
|
*/
|
|
525
|
-
export const
|
|
336
|
+
export const takeWhile = dual(2, core.takeWhile);
|
|
526
337
|
/**
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
* @since 1.18.0
|
|
530
|
-
* @category slicing
|
|
338
|
+
* @since 1.20.0
|
|
531
339
|
*/
|
|
532
|
-
export const
|
|
340
|
+
export const takeUntil = dual(2, core.takeUntil);
|
|
533
341
|
/**
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
* @since 1.18.0
|
|
537
|
-
* @category slicing
|
|
342
|
+
* @since 1.20.0
|
|
538
343
|
*/
|
|
539
|
-
export const
|
|
344
|
+
export const dropWhile = dual(2, core.dropWhile);
|
|
540
345
|
/**
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
* @since 1.18.0
|
|
544
|
-
* @category slicing
|
|
346
|
+
* @since 1.20.0
|
|
545
347
|
*/
|
|
546
|
-
export const
|
|
348
|
+
export const dropUntil = dual(2, core.dropUntil);
|
|
547
349
|
/**
|
|
548
|
-
*
|
|
549
|
-
*
|
|
550
|
-
* @since 1.18.0
|
|
551
|
-
* @category slicing
|
|
350
|
+
* @since 1.20.0
|
|
552
351
|
*/
|
|
553
|
-
export const
|
|
352
|
+
export const dropAfter = dual(2, core.dropAfter);
|
|
554
353
|
/**
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
* @since 1.18.0
|
|
558
|
-
* @category slicing
|
|
354
|
+
* @since 1.20.0
|
|
559
355
|
*/
|
|
560
|
-
export const
|
|
356
|
+
export const takeWhileEffect = dual(2, core.takeWhileEffect);
|
|
561
357
|
/**
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
* @since 1.18.0
|
|
565
|
-
* @category slicing
|
|
358
|
+
* @since 1.20.0
|
|
566
359
|
*/
|
|
567
|
-
export const
|
|
360
|
+
export const takeUntiEffect = dual(2, core.takeUntilEffect);
|
|
568
361
|
/**
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
* @since 1.18.0
|
|
572
|
-
* @category combinators
|
|
362
|
+
* @since 1.20.0
|
|
573
363
|
*/
|
|
574
|
-
export const
|
|
364
|
+
export const dropWhileEffect = dual(2, core.dropWhileEffect);
|
|
575
365
|
/**
|
|
576
|
-
*
|
|
577
|
-
*
|
|
578
|
-
* @since 1.18.0
|
|
579
|
-
* @category combinators
|
|
366
|
+
* @since 1.20.0
|
|
580
367
|
*/
|
|
581
|
-
export const
|
|
368
|
+
export const dropUntilEffect = dual(2, core.dropUntilEffect);
|
|
582
369
|
/**
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
* @since 1.18.0
|
|
586
|
-
* @category combinators
|
|
370
|
+
* @since 1.20.0
|
|
587
371
|
*/
|
|
588
|
-
export const
|
|
372
|
+
export const dropAfterEffect = dual(2, core.dropAfterEffect);
|
|
589
373
|
/**
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
* @since 1.18.0
|
|
593
|
-
* @category combinators
|
|
374
|
+
* @since 1.20.0
|
|
594
375
|
*/
|
|
595
|
-
export const
|
|
376
|
+
export const during = dual(2, core.during);
|
|
596
377
|
/**
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
* @since 1.18.0
|
|
600
|
-
* @category combinators
|
|
378
|
+
* @since 1.20.0
|
|
601
379
|
*/
|
|
602
|
-
export const
|
|
380
|
+
export const since = dual(2, core.since);
|
|
603
381
|
/**
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
* @since 1.18.0
|
|
607
|
-
* @category combinators
|
|
382
|
+
* @since 1.20.0
|
|
608
383
|
*/
|
|
609
|
-
export const
|
|
384
|
+
export const until = dual(2, core.until);
|
|
610
385
|
/**
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
* @since 1.18.0
|
|
614
|
-
* @category combinators
|
|
386
|
+
* @since 1.20.0
|
|
615
387
|
*/
|
|
616
|
-
export const middleware = core.middleware;
|
|
388
|
+
export const middleware = dual(isDataFirstFx, core.middleware);
|
|
617
389
|
/**
|
|
618
|
-
*
|
|
619
|
-
*
|
|
620
|
-
* @since 1.18.0
|
|
621
|
-
* @category combinators
|
|
390
|
+
* @since 1.20.0
|
|
622
391
|
*/
|
|
623
|
-
export const
|
|
392
|
+
export const onExit = dual(2, core.onExit);
|
|
624
393
|
/**
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
* @since 1.18.0
|
|
628
|
-
* @category combinators
|
|
394
|
+
* @since 1.20.0
|
|
629
395
|
*/
|
|
630
|
-
export const
|
|
396
|
+
export const onInterrupt = dual(2, core.onInterrupt);
|
|
631
397
|
/**
|
|
632
|
-
*
|
|
633
|
-
* useing an Effect. A SynchronizedRef is utilized to ensure ordering of events.
|
|
634
|
-
*
|
|
635
|
-
* @since 1.18.0
|
|
636
|
-
* @category combinators
|
|
398
|
+
* @since 1.20.0
|
|
637
399
|
*/
|
|
638
|
-
export const
|
|
400
|
+
export const onError = dual(2, core.onError);
|
|
639
401
|
/**
|
|
640
|
-
*
|
|
641
|
-
*
|
|
642
|
-
* @since 1.18.0
|
|
643
|
-
* @category combinators
|
|
402
|
+
* @since 1.20.0
|
|
644
403
|
*/
|
|
645
|
-
export const
|
|
404
|
+
export const scoped = core.scoped;
|
|
646
405
|
/**
|
|
647
|
-
*
|
|
648
|
-
*
|
|
649
|
-
* @since 1.18.0
|
|
650
|
-
* @category combinators
|
|
406
|
+
* @since 1.20.0
|
|
651
407
|
*/
|
|
652
|
-
export const
|
|
408
|
+
export const annotateLogs = dual(isDataFirstFx, core.annotateLogs);
|
|
653
409
|
/**
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
* @since 1.18.0
|
|
657
|
-
* @category combinators
|
|
410
|
+
* @since 1.20.0
|
|
658
411
|
*/
|
|
659
|
-
export const
|
|
412
|
+
export const annotateSpans = dual(isDataFirstFx, core.annotateSpans);
|
|
660
413
|
/**
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
* @since 1.18.0
|
|
664
|
-
* @category combinators
|
|
414
|
+
* @since 1.20.0
|
|
665
415
|
*/
|
|
666
|
-
export const
|
|
416
|
+
export const interruptible = core.interruptible;
|
|
667
417
|
/**
|
|
668
|
-
*
|
|
669
|
-
* with the provided FlattenStrategy.
|
|
670
|
-
* @since 1.18.0
|
|
671
|
-
* @category flattening
|
|
418
|
+
* @since 1.20.0
|
|
672
419
|
*/
|
|
673
|
-
export const
|
|
420
|
+
export const uninterruptible = core.uninterruptible;
|
|
674
421
|
/**
|
|
675
|
-
*
|
|
676
|
-
* with the provided FlattenStrategy.
|
|
677
|
-
* @since 1.18.0
|
|
678
|
-
* @category flattening
|
|
422
|
+
* @since 1.20.0
|
|
679
423
|
*/
|
|
680
|
-
export const
|
|
424
|
+
export const locally = dual(3, core.locally);
|
|
681
425
|
/**
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
* @since 1.18.0
|
|
685
|
-
* @category flattening
|
|
426
|
+
* @since 1.20.0
|
|
686
427
|
*/
|
|
687
|
-
export const
|
|
428
|
+
export const locallyWith = dual(3, core.locallyWith);
|
|
688
429
|
/**
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
* @since 1.18.0
|
|
692
|
-
* @category flattening
|
|
430
|
+
* @since 1.20.0
|
|
693
431
|
*/
|
|
694
|
-
export const
|
|
432
|
+
export const withTracerTiming = dual(2, core.withTracerTiming);
|
|
695
433
|
/**
|
|
696
|
-
*
|
|
697
|
-
*
|
|
698
|
-
* @since 1.18.0
|
|
699
|
-
* @category flattening
|
|
434
|
+
* @since 1.20.0
|
|
700
435
|
*/
|
|
701
|
-
export const
|
|
436
|
+
export const withConcurrency = dual(2, core.withConcurrency);
|
|
702
437
|
/**
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
* @since 1.18.0
|
|
706
|
-
* @category flattening
|
|
438
|
+
* @since 1.20.0
|
|
707
439
|
*/
|
|
708
|
-
export const
|
|
440
|
+
export const withConfigProvider = dual(2, core.withConfigProvider);
|
|
709
441
|
/**
|
|
710
|
-
*
|
|
711
|
-
* Fx emitted and interrupting the previous.
|
|
712
|
-
*
|
|
713
|
-
* @since 1.18.0
|
|
714
|
-
* @category flattening
|
|
442
|
+
* @since 1.20.0
|
|
715
443
|
*/
|
|
716
|
-
export const
|
|
444
|
+
export const withLogSpan = dual(2, core.withLogSpan);
|
|
717
445
|
/**
|
|
718
|
-
*
|
|
719
|
-
* Fx emitted and interrupting the previous.
|
|
720
|
-
*
|
|
721
|
-
* @since 1.18.0
|
|
722
|
-
* @category flattening
|
|
446
|
+
* @since 1.20.0
|
|
723
447
|
*/
|
|
724
|
-
export const
|
|
448
|
+
export const withMaxOpsBeforeYield = dual(2, core.withMaxOpsBeforeYield);
|
|
725
449
|
/**
|
|
726
|
-
*
|
|
727
|
-
* Fx emitted and dropping any subsequent Fx until it has completed.
|
|
728
|
-
*
|
|
729
|
-
* @since 1.18.0
|
|
730
|
-
* @category flattening
|
|
450
|
+
* @since 1.20.0
|
|
731
451
|
*/
|
|
732
|
-
export const
|
|
452
|
+
export const withParentSpan = dual(2, core.withParentSpan);
|
|
733
453
|
/**
|
|
734
|
-
*
|
|
735
|
-
* Fx emitted and dropping any subsequent Fx until it has completed.
|
|
736
|
-
*
|
|
737
|
-
* @since 1.18.0
|
|
738
|
-
* @category flattening
|
|
454
|
+
* @since 1.20.0
|
|
739
455
|
*/
|
|
740
|
-
export const
|
|
456
|
+
export const withRequestBatching = dual(2, core.withRequestBatching);
|
|
741
457
|
/**
|
|
742
|
-
*
|
|
743
|
-
* until completion, and then running the last emitted Fx if they are not
|
|
744
|
-
* the same Fx.
|
|
745
|
-
*
|
|
746
|
-
* @since 1.18.0
|
|
747
|
-
* @category flattening
|
|
458
|
+
* @since 1.20.0
|
|
748
459
|
*/
|
|
749
|
-
export const
|
|
460
|
+
export const withRequestCache = dual(2, core.withRequestCache);
|
|
750
461
|
/**
|
|
751
|
-
*
|
|
752
|
-
* until completion, and then running the last emitted Fx if they are not
|
|
753
|
-
* the same Fx.
|
|
754
|
-
*
|
|
755
|
-
* @since 1.18.0
|
|
756
|
-
* @category flattening
|
|
462
|
+
* @since 1.20.0
|
|
757
463
|
*/
|
|
758
|
-
export const
|
|
464
|
+
export const withRequestCaching = dual(2, core.withRequestCaching);
|
|
759
465
|
/**
|
|
760
|
-
*
|
|
761
|
-
*
|
|
762
|
-
* @since 1.18.0
|
|
763
|
-
* @category flattening
|
|
466
|
+
* @since 1.20.0
|
|
764
467
|
*/
|
|
765
|
-
export const
|
|
468
|
+
export const withTracer = dual(2, core.withTracer);
|
|
766
469
|
/**
|
|
767
|
-
*
|
|
768
|
-
*
|
|
769
|
-
* @since 1.18.0
|
|
770
|
-
* @category flattening
|
|
470
|
+
* @since 1.20.0
|
|
771
471
|
*/
|
|
772
|
-
export const
|
|
472
|
+
export const acquireUseRelease = dual(3, core.acquireUseRelease);
|
|
773
473
|
/**
|
|
774
|
-
*
|
|
775
|
-
*
|
|
776
|
-
* @since 1.18.0
|
|
777
|
-
* @category flattening
|
|
474
|
+
* @since 1.20.0
|
|
778
475
|
*/
|
|
779
|
-
export const
|
|
476
|
+
export const withSpan = dual(3, core.withSpan);
|
|
780
477
|
/**
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
* @since 1.18.0
|
|
784
|
-
* @category flattening
|
|
478
|
+
* @since 1.20.0
|
|
785
479
|
*/
|
|
786
|
-
export const
|
|
480
|
+
export const provideContext = dual(2, core.provideContext);
|
|
787
481
|
/**
|
|
788
|
-
*
|
|
789
|
-
*
|
|
790
|
-
* @since 1.18.0
|
|
791
|
-
* @category flattening
|
|
482
|
+
* @since 1.20.0
|
|
792
483
|
*/
|
|
793
|
-
export const
|
|
484
|
+
export const provideLayer = dual(2, core.provideLayer);
|
|
794
485
|
/**
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
* @since 1.18.0
|
|
798
|
-
* @category flattening
|
|
486
|
+
* @since 1.20.0
|
|
799
487
|
*/
|
|
800
|
-
export const
|
|
488
|
+
export const provideRuntime = dual(2, core.provideRuntime);
|
|
801
489
|
/**
|
|
802
|
-
*
|
|
803
|
-
* Fx emitted and interrupting the previous.
|
|
804
|
-
*
|
|
805
|
-
* @since 1.18.0
|
|
806
|
-
* @category flattening
|
|
490
|
+
* @since 1.20.0
|
|
807
491
|
*/
|
|
808
|
-
export const
|
|
492
|
+
export const provideService = dual(3, core.provideService);
|
|
809
493
|
/**
|
|
810
|
-
*
|
|
811
|
-
* Fx emitted and interrupting the previous.
|
|
812
|
-
*
|
|
813
|
-
* @since 1.18.0
|
|
814
|
-
* @category flattening
|
|
494
|
+
* @since 1.20.0
|
|
815
495
|
*/
|
|
816
|
-
export const
|
|
496
|
+
export const provideServiceEffect = dual(3, core.provideServiceEffect);
|
|
817
497
|
/**
|
|
818
|
-
*
|
|
819
|
-
* Fx emitted and dropping any subsequent Fx until it has completed.
|
|
820
|
-
*
|
|
821
|
-
* @since 1.18.0
|
|
822
|
-
* @category flattening
|
|
498
|
+
* @since 1.20.0
|
|
823
499
|
*/
|
|
824
|
-
export const
|
|
500
|
+
export const provide = dual(2, core.provide);
|
|
825
501
|
/**
|
|
826
|
-
*
|
|
827
|
-
* Fx emitted and dropping any subsequent Fx until it has completed.
|
|
828
|
-
*
|
|
829
|
-
* @since 1.18.0
|
|
830
|
-
* @category flattening
|
|
502
|
+
* @since 1.20.0
|
|
831
503
|
*/
|
|
832
|
-
export const
|
|
504
|
+
export const share = dual(2, coreShare.share);
|
|
833
505
|
/**
|
|
834
|
-
*
|
|
835
|
-
* Fx emitted and starting the latest Fx when the first completes
|
|
836
|
-
* if they are not the same Fx.
|
|
837
|
-
*
|
|
838
|
-
* @since 1.18.0
|
|
839
|
-
* @category flattening
|
|
506
|
+
* @since 1.20.0
|
|
840
507
|
*/
|
|
841
|
-
export const
|
|
508
|
+
export const multicast = coreShare.multicast;
|
|
842
509
|
/**
|
|
843
|
-
*
|
|
844
|
-
* Fx emitted and starting the latest Fx when the first completes
|
|
845
|
-
* if they are not the same Fx.
|
|
846
|
-
*
|
|
847
|
-
* @since 1.18.0
|
|
848
|
-
* @category flattening
|
|
510
|
+
* @since 1.20.0
|
|
849
511
|
*/
|
|
850
|
-
export const
|
|
512
|
+
export const hold = coreShare.hold;
|
|
851
513
|
/**
|
|
852
|
-
*
|
|
853
|
-
* emits the inner stream, the fx will begin allowing events to pass through,
|
|
854
|
-
* and when the inner stream emits, the fx will be interrupted.
|
|
855
|
-
*
|
|
856
|
-
* @since 1.18.0
|
|
857
|
-
* @category time slicing
|
|
514
|
+
* @since 1.20.0
|
|
858
515
|
*/
|
|
859
|
-
export const
|
|
516
|
+
export const replay = dual(2, coreShare.replay);
|
|
860
517
|
/**
|
|
861
|
-
*
|
|
862
|
-
*
|
|
863
|
-
* @since 1.18.0
|
|
864
|
-
* @category time slicing
|
|
518
|
+
* @since 1.20.0
|
|
865
519
|
*/
|
|
866
|
-
export const
|
|
520
|
+
export const mapCause = dual(2, core.mapCause);
|
|
867
521
|
/**
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
* @since 1.18.0
|
|
871
|
-
* @category time slicing
|
|
522
|
+
* @since 1.20.0
|
|
872
523
|
*/
|
|
873
|
-
export const
|
|
524
|
+
export const mapError = dual(2, core.mapError);
|
|
874
525
|
/**
|
|
875
|
-
*
|
|
876
|
-
*
|
|
877
|
-
* @since 1.18.0
|
|
878
|
-
* @category context
|
|
526
|
+
* @since 1.20.0
|
|
879
527
|
*/
|
|
880
|
-
export const
|
|
528
|
+
export const mapBoth = dual(3, core.mapBoth);
|
|
881
529
|
/**
|
|
882
|
-
*
|
|
883
|
-
* @since 1.18.0
|
|
884
|
-
* @category context
|
|
530
|
+
* @since 1.20.0
|
|
885
531
|
*/
|
|
886
|
-
export const
|
|
532
|
+
export const filterCause = dual(2, core.filterCause);
|
|
887
533
|
/**
|
|
888
|
-
*
|
|
889
|
-
*
|
|
890
|
-
* @since 1.18.0
|
|
891
|
-
* @category context
|
|
534
|
+
* @since 1.20.0
|
|
892
535
|
*/
|
|
893
|
-
export const
|
|
536
|
+
export const filterError = dual(2, core.filterError);
|
|
894
537
|
/**
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
* @since 1.18.0
|
|
898
|
-
* @category slicing
|
|
538
|
+
* @since 1.20.0
|
|
899
539
|
*/
|
|
900
|
-
export const
|
|
540
|
+
export const filterMapCause = dual(2, core.filterMapCause);
|
|
901
541
|
/**
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
* @since 1.18.0
|
|
905
|
-
* @category slicing
|
|
542
|
+
* @since 1.20.0
|
|
906
543
|
*/
|
|
907
|
-
export const
|
|
544
|
+
export const filterMapError = dual(2, core.filterMapError);
|
|
908
545
|
/**
|
|
909
|
-
*
|
|
910
|
-
*
|
|
911
|
-
* @since 1.18.0
|
|
912
|
-
* @category combinators
|
|
546
|
+
* @since 1.20.0
|
|
913
547
|
*/
|
|
914
|
-
export const
|
|
548
|
+
export const mapCauseEffect = dual(2, core.mapCauseEffect);
|
|
915
549
|
/**
|
|
916
|
-
*
|
|
917
|
-
* provided Subject.
|
|
918
|
-
*
|
|
919
|
-
* @since 1.18.0
|
|
920
|
-
* @category sharing
|
|
550
|
+
* @since 1.20.0
|
|
921
551
|
*/
|
|
922
|
-
export const
|
|
552
|
+
export const mapErrorEffect = dual(2, core.mapErrorEffect);
|
|
923
553
|
/**
|
|
924
|
-
*
|
|
925
|
-
*
|
|
926
|
-
* @since 1.18.0
|
|
927
|
-
* @category sharing
|
|
554
|
+
* @since 1.20.0
|
|
928
555
|
*/
|
|
929
|
-
export const
|
|
556
|
+
export const filterCauseEffect = dual(2, core.filterCauseEffect);
|
|
930
557
|
/**
|
|
931
|
-
*
|
|
932
|
-
* recent event and emitting it to new subscribers.
|
|
933
|
-
*
|
|
934
|
-
* @since 1.18.0
|
|
935
|
-
* @category sharing
|
|
558
|
+
* @since 1.20.0
|
|
936
559
|
*/
|
|
937
|
-
export const
|
|
560
|
+
export const filterErrorEffect = dual(2, core.filterErrorEffect);
|
|
938
561
|
/**
|
|
939
|
-
*
|
|
940
|
-
* saving up to the most recent `n` events and emitting them to new subscribers.
|
|
941
|
-
*
|
|
942
|
-
* @since 1.18.0
|
|
943
|
-
* @category sharing
|
|
562
|
+
* @since 1.20.0
|
|
944
563
|
*/
|
|
945
|
-
export const
|
|
564
|
+
export const filterMapCauseEffect = dual(2, core.filterMapCauseEffect);
|
|
946
565
|
/**
|
|
947
|
-
*
|
|
948
|
-
* events have occurred before emitting a value.
|
|
949
|
-
* @since 1.18.0
|
|
950
|
-
* @category time slicing
|
|
566
|
+
* @since 1.20.0
|
|
951
567
|
*/
|
|
952
|
-
export const
|
|
568
|
+
export const filterMapErrorEffect = dual(2, core.filterMapErrorEffect);
|
|
953
569
|
/**
|
|
954
|
-
*
|
|
955
|
-
* an event after the last event.
|
|
956
|
-
* @since 1.18.0
|
|
957
|
-
* @category time slicing
|
|
570
|
+
* @since 1.20.0
|
|
958
571
|
*/
|
|
959
|
-
export const
|
|
572
|
+
export const loopCause = dual(3, core.loopCause);
|
|
960
573
|
/**
|
|
961
|
-
*
|
|
962
|
-
* events have occurred before emitting a value.
|
|
963
|
-
* @since 1.18.0
|
|
964
|
-
* @category combinators
|
|
574
|
+
* @since 1.20.0
|
|
965
575
|
*/
|
|
966
|
-
export const
|
|
576
|
+
export const loopError = dual(3, core.loopError);
|
|
967
577
|
/**
|
|
968
|
-
*
|
|
969
|
-
* @since 1.18.0
|
|
970
|
-
* @category constructors
|
|
578
|
+
* @since 1.20.0
|
|
971
579
|
*/
|
|
972
|
-
export const
|
|
580
|
+
export const loopCauseEffect = dual(3, core.loopCauseEffect);
|
|
973
581
|
/**
|
|
974
|
-
*
|
|
975
|
-
* @since 1.18.0
|
|
976
|
-
* @category constructors
|
|
582
|
+
* @since 1.20.0
|
|
977
583
|
*/
|
|
978
|
-
export
|
|
979
|
-
return fromFxEffect(Effect.gen(f));
|
|
980
|
-
}
|
|
584
|
+
export const loopErrorEffect = dual(3, core.loopErrorEffect);
|
|
981
585
|
/**
|
|
982
|
-
*
|
|
983
|
-
* @since 1.18.0
|
|
984
|
-
* @category constructors
|
|
586
|
+
* @since 1.20.0
|
|
985
587
|
*/
|
|
986
|
-
export
|
|
987
|
-
return scoped(fromFxEffect(Effect.gen(f)));
|
|
988
|
-
}
|
|
588
|
+
export const filterMapLoopCause = dual(3, core.filterMapLoopCause);
|
|
989
589
|
/**
|
|
990
|
-
*
|
|
991
|
-
* @since 1.18.0
|
|
992
|
-
* @category lifecycles
|
|
590
|
+
* @since 1.20.0
|
|
993
591
|
*/
|
|
994
|
-
export const
|
|
592
|
+
export const filterMapLoopError = dual(3, core.filterMapLoopError);
|
|
995
593
|
/**
|
|
996
|
-
*
|
|
997
|
-
* @since 1.18.0
|
|
998
|
-
* @category lifecycles
|
|
594
|
+
* @since 1.20.0
|
|
999
595
|
*/
|
|
1000
|
-
export const
|
|
596
|
+
export const filterMapLoopCauseEffect = dual(3, core.filterMapLoopCauseEffect);
|
|
1001
597
|
/**
|
|
1002
|
-
*
|
|
1003
|
-
* @since 1.18.0
|
|
1004
|
-
* @category lifecycles
|
|
598
|
+
* @since 1.20.0
|
|
1005
599
|
*/
|
|
1006
|
-
export const
|
|
600
|
+
export const filterMapLoopErrorEffect = dual(3, core.filterMapLoopErrorEffect);
|
|
1007
601
|
/**
|
|
1008
|
-
*
|
|
1009
|
-
* @since 1.18.0
|
|
1010
|
-
* @category context
|
|
602
|
+
* @since 1.20.0
|
|
1011
603
|
*/
|
|
1012
|
-
export const
|
|
604
|
+
export const flatMapCauseWithStrategy = dual(isDataFirstFx, core.flatMapCauseWithStrategy);
|
|
1013
605
|
/**
|
|
1014
|
-
*
|
|
1015
|
-
* @since 1.18.0
|
|
1016
|
-
* @category combinators
|
|
606
|
+
* @since 1.20.0
|
|
1017
607
|
*/
|
|
1018
|
-
export const
|
|
608
|
+
export const flatMapErrorWithStrategy = dual(isDataFirstFx, core.flatMapErrorWithStrategy);
|
|
1019
609
|
/**
|
|
1020
|
-
*
|
|
1021
|
-
* @since 1.18.0
|
|
1022
|
-
* @category combinators
|
|
1023
|
-
*/
|
|
1024
|
-
export const annotateSpans = internal.annotateSpans;
|
|
1025
|
-
/**
|
|
1026
|
-
* Create an Fx which will succeed with Option.None
|
|
1027
|
-
* @since 1.18.0
|
|
1028
|
-
* @category constructors
|
|
610
|
+
* @since 1.20.0
|
|
1029
611
|
*/
|
|
1030
|
-
export const
|
|
612
|
+
export const switchMapCause = dual(isDataFirstFx, core.switchMapCause);
|
|
1031
613
|
/**
|
|
1032
|
-
*
|
|
1033
|
-
* @since 1.18.0
|
|
1034
|
-
* @category constructors
|
|
614
|
+
* @since 1.20.0
|
|
1035
615
|
*/
|
|
1036
|
-
export const
|
|
616
|
+
export const switchMapError = dual(isDataFirstFx, core.switchMapError);
|
|
1037
617
|
/**
|
|
1038
|
-
*
|
|
1039
|
-
* @since 1.18.0
|
|
1040
|
-
* @category Do
|
|
618
|
+
* @since 1.20.0
|
|
1041
619
|
*/
|
|
1042
|
-
export const
|
|
620
|
+
export const flatMapCause = dual(isDataFirstFx, core.flatMapCause);
|
|
1043
621
|
/**
|
|
1044
|
-
*
|
|
1045
|
-
* @since 1.18.0
|
|
1046
|
-
* @category Do
|
|
622
|
+
* @since 1.20.0
|
|
1047
623
|
*/
|
|
1048
|
-
export const
|
|
624
|
+
export const flatMapError = dual(isDataFirstFx, core.flatMapError);
|
|
1049
625
|
/**
|
|
1050
|
-
*
|
|
1051
|
-
* @since 1.18.0
|
|
1052
|
-
* @category Do
|
|
626
|
+
* @since 1.20.0
|
|
1053
627
|
*/
|
|
1054
|
-
export const
|
|
1055
|
-
const let_ = internal.let;
|
|
1056
|
-
export {
|
|
628
|
+
export const flatMapCauseConcurrently = dual(isDataFirstFx, core.flatMapCauseConcurrently);
|
|
1057
629
|
/**
|
|
1058
|
-
*
|
|
1059
|
-
* @since 1.18.0
|
|
1060
|
-
* @category Do
|
|
630
|
+
* @since 1.20.0
|
|
1061
631
|
*/
|
|
1062
|
-
|
|
632
|
+
export const flatMapErrorConcurrently = dual(isDataFirstFx, core.flatMapErrorConcurrently);
|
|
1063
633
|
/**
|
|
1064
|
-
*
|
|
1065
|
-
* @since 1.18.0
|
|
1066
|
-
* @category combinators
|
|
634
|
+
* @since 1.20.0
|
|
1067
635
|
*/
|
|
1068
|
-
export const
|
|
636
|
+
export const exhaustMapCause = dual(isDataFirstFx, core.exhaustMapCause);
|
|
1069
637
|
/**
|
|
1070
|
-
*
|
|
1071
|
-
* @since 1.18.0
|
|
1072
|
-
* @category combinators
|
|
638
|
+
* @since 1.20.0
|
|
1073
639
|
*/
|
|
1074
|
-
export const
|
|
640
|
+
export const exhaustMapError = dual(isDataFirstFx, core.exhaustMapError);
|
|
1075
641
|
/**
|
|
1076
|
-
*
|
|
1077
|
-
* @since 1.18.0
|
|
1078
|
-
* @category combinators
|
|
642
|
+
* @since 1.20.0
|
|
1079
643
|
*/
|
|
1080
|
-
export const
|
|
644
|
+
export const exhaustMapLatestCause = dual(isDataFirstFx, core.exhaustMapLatestCause);
|
|
1081
645
|
/**
|
|
1082
|
-
*
|
|
1083
|
-
* @since 1.18.0
|
|
1084
|
-
* @category running
|
|
646
|
+
* @since 1.20.0
|
|
1085
647
|
*/
|
|
1086
|
-
export const
|
|
648
|
+
export const exhaustMapLatestError = dual(isDataFirstFx, core.exhaustMapLatestError);
|
|
1087
649
|
/**
|
|
1088
|
-
*
|
|
1089
|
-
* @since 1.18.0
|
|
1090
|
-
* @category running
|
|
650
|
+
* @since 1.20.0
|
|
1091
651
|
*/
|
|
1092
|
-
export const
|
|
652
|
+
export const matchCauseWithStrategy = dual(3, core.matchCauseWithStrategy);
|
|
1093
653
|
/**
|
|
1094
|
-
*
|
|
1095
|
-
* @since 1.18.0
|
|
1096
|
-
* @category combinators
|
|
654
|
+
* @since 1.20.0
|
|
1097
655
|
*/
|
|
1098
|
-
export const
|
|
656
|
+
export const matchErrorWithStrategy = dual(3, core.matchErrorWithStrategy);
|
|
1099
657
|
/**
|
|
1100
|
-
*
|
|
1101
|
-
* @since 1.18.0
|
|
1102
|
-
* @category constructors
|
|
658
|
+
* @since 1.20.0
|
|
1103
659
|
*/
|
|
1104
|
-
export const
|
|
1105
|
-
const if_ = internal.if;
|
|
1106
|
-
export {
|
|
660
|
+
export const matchCause = dual(2, core.matchCause);
|
|
1107
661
|
/**
|
|
1108
|
-
*
|
|
1109
|
-
* @since 1.18.0
|
|
1110
|
-
* @category combinators
|
|
662
|
+
* @since 1.20.0
|
|
1111
663
|
*/
|
|
1112
|
-
|
|
664
|
+
export const matchError = dual(2, core.matchError);
|
|
1113
665
|
/**
|
|
1114
|
-
*
|
|
1115
|
-
* @since 1.18.0
|
|
1116
|
-
* @category combinators
|
|
666
|
+
* @since 1.20.0
|
|
1117
667
|
*/
|
|
1118
|
-
export const
|
|
668
|
+
export const matchCauseConcurrently = dual(3, core.matchCauseConcurrently);
|
|
1119
669
|
/**
|
|
1120
|
-
*
|
|
1121
|
-
* @since 1.18.0
|
|
1122
|
-
* @category combinators
|
|
670
|
+
* @since 1.20.0
|
|
1123
671
|
*/
|
|
1124
|
-
export const
|
|
672
|
+
export const matchErrorConcurrently = dual(3, core.matchErrorConcurrently);
|
|
1125
673
|
/**
|
|
1126
|
-
*
|
|
1127
|
-
* @since 1.18.0
|
|
1128
|
-
* @category combinators
|
|
674
|
+
* @since 1.20.0
|
|
1129
675
|
*/
|
|
1130
|
-
export const
|
|
676
|
+
export const switchMatchCause = dual(2, core.switchMatchCause);
|
|
1131
677
|
/**
|
|
1132
|
-
*
|
|
1133
|
-
* @since 1.18.0
|
|
1134
|
-
* @category FiberRef
|
|
678
|
+
* @since 1.20.0
|
|
1135
679
|
*/
|
|
1136
|
-
export const
|
|
680
|
+
export const switchMatchError = dual(2, core.switchMatchError);
|
|
1137
681
|
/**
|
|
1138
|
-
*
|
|
1139
|
-
* @since 1.18.0
|
|
1140
|
-
* @category FiberRef
|
|
682
|
+
* @since 1.20.0
|
|
1141
683
|
*/
|
|
1142
|
-
export const
|
|
684
|
+
export const exhaustMatchCause = dual(2, core.exhaustMatchCause);
|
|
1143
685
|
/**
|
|
1144
|
-
*
|
|
1145
|
-
* @since 1.18.0
|
|
1146
|
-
* @category tracing
|
|
686
|
+
* @since 1.20.0
|
|
1147
687
|
*/
|
|
1148
|
-
export const
|
|
688
|
+
export const exhaustMatchError = dual(2, core.exhaustMatchError);
|
|
1149
689
|
/**
|
|
1150
|
-
*
|
|
1151
|
-
* @since 1.18.0
|
|
1152
|
-
* @category concurrency
|
|
690
|
+
* @since 1.20.0
|
|
1153
691
|
*/
|
|
1154
|
-
export const
|
|
692
|
+
export const exhaustMatchLatestCause = dual(2, core.exhaustMatchLatestCause);
|
|
1155
693
|
/**
|
|
1156
|
-
*
|
|
1157
|
-
* @since 1.18.0
|
|
1158
|
-
* @category logging
|
|
694
|
+
* @since 1.20.0
|
|
1159
695
|
*/
|
|
1160
|
-
export const
|
|
696
|
+
export const exhaustMatchLatestError = dual(2, core.exhaustMatchLatestError);
|
|
1161
697
|
/**
|
|
1162
|
-
*
|
|
1163
|
-
* @since 1.18.0
|
|
1164
|
-
* @category concurrency
|
|
698
|
+
* @since 1.20.0
|
|
1165
699
|
*/
|
|
1166
|
-
export const
|
|
700
|
+
export const exit = core.exit;
|
|
1167
701
|
/**
|
|
1168
|
-
*
|
|
1169
|
-
* @since 1.18.0
|
|
1170
|
-
* @category tracing
|
|
702
|
+
* @since 1.20.0
|
|
1171
703
|
*/
|
|
1172
|
-
export const
|
|
704
|
+
export const either = core.either;
|
|
1173
705
|
/**
|
|
1174
|
-
*
|
|
1175
|
-
* @since 1.18.0
|
|
1176
|
-
* @category batching
|
|
706
|
+
* @since 1.20.0
|
|
1177
707
|
*/
|
|
1178
|
-
export const
|
|
708
|
+
export const tuple = core.tuple;
|
|
1179
709
|
/**
|
|
1180
|
-
*
|
|
1181
|
-
* @since 1.18.0
|
|
1182
|
-
* @category batching
|
|
710
|
+
* @since 1.20.0
|
|
1183
711
|
*/
|
|
1184
|
-
export const
|
|
712
|
+
export const struct = core.struct;
|
|
1185
713
|
/**
|
|
1186
|
-
*
|
|
1187
|
-
* @since 1.18.0
|
|
1188
|
-
* @category batching
|
|
714
|
+
* @since 1.20.0
|
|
1189
715
|
*/
|
|
1190
|
-
export const
|
|
716
|
+
export const all = core.all;
|
|
1191
717
|
/**
|
|
1192
|
-
*
|
|
1193
|
-
* @since 1.18.0
|
|
1194
|
-
* @category concurrency
|
|
718
|
+
* @since 1.20.0
|
|
1195
719
|
*/
|
|
1196
|
-
export const
|
|
720
|
+
export const toEnqueue = dual(2, core.toEnqueue);
|
|
1197
721
|
/**
|
|
1198
|
-
*
|
|
1199
|
-
* @since 1.18.0
|
|
1200
|
-
* @category tracing
|
|
722
|
+
* @since 1.20.0
|
|
1201
723
|
*/
|
|
1202
|
-
export const
|
|
724
|
+
export const debounce = dual(2, core.debounce);
|
|
1203
725
|
/**
|
|
1204
|
-
*
|
|
1205
|
-
* @since 1.18.0
|
|
1206
|
-
* @category tracing
|
|
726
|
+
* @since 1.20.0
|
|
1207
727
|
*/
|
|
1208
|
-
export const
|
|
728
|
+
export const throttle = dual(2, core.throttle);
|
|
1209
729
|
/**
|
|
1210
|
-
*
|
|
1211
|
-
* @since 1.18.0
|
|
1212
|
-
* @category combinators
|
|
730
|
+
* @since 1.20.0
|
|
1213
731
|
*/
|
|
1214
|
-
export const
|
|
732
|
+
export const throttleLatest = dual(2, core.throttleLatest);
|
|
1215
733
|
/**
|
|
1216
|
-
*
|
|
1217
|
-
* even when the list has been re-ordered.
|
|
1218
|
-
*
|
|
1219
|
-
* @since 1.18.0
|
|
1220
|
-
* @category combinators
|
|
734
|
+
* @since 1.20.0
|
|
1221
735
|
*/
|
|
1222
|
-
export const keyed = dual(
|
|
736
|
+
export const keyed = dual(2, coreKeyed.keyed);
|
|
1223
737
|
/**
|
|
1224
|
-
*
|
|
1225
|
-
* instead of providing the value directly, it is exposed as a RefSubject to
|
|
1226
|
-
* allow creating a persistent workflows similar to Fx.keyed but for a single value.
|
|
1227
|
-
*
|
|
1228
|
-
* @since 1.18.0
|
|
1229
|
-
* @category combinators
|
|
738
|
+
* @since 1.20.0
|
|
1230
739
|
*/
|
|
1231
|
-
export const withKey = dual(
|
|
740
|
+
export const withKey = dual(2, coreWithKey.withKey);
|
|
1232
741
|
const getTag = (a) => a._tag;
|
|
1233
742
|
/**
|
|
1234
743
|
* Match over a tagged union of values into a set of persistent workflows
|
|
1235
744
|
* that allow listening to changes of values with the same tag using the same
|
|
1236
745
|
* Fx.
|
|
1237
746
|
*
|
|
1238
|
-
* @since 1.
|
|
747
|
+
* @since 1.20.0
|
|
1239
748
|
* @category combinators
|
|
1240
749
|
*/
|
|
1241
750
|
export const matchTags = dual(2, function matchTags(fx, matchers) {
|
|
1242
|
-
return withKey(fx,
|
|
751
|
+
return withKey(fx, {
|
|
752
|
+
getKey: getTag,
|
|
753
|
+
onValue: (ref, tag) => matchers[tag](ref)
|
|
754
|
+
});
|
|
1243
755
|
});
|
|
1244
756
|
/**
|
|
1245
|
-
* @since 1.
|
|
1246
|
-
*/
|
|
1247
|
-
export const drainLayer = internal.drainLayer;
|
|
1248
|
-
/* #endregion */
|
|
1249
|
-
/**
|
|
1250
|
-
* @since 1.18.0
|
|
1251
|
-
*/
|
|
1252
|
-
export function isFx(u) {
|
|
1253
|
-
return typeof u === "object" && u !== null && TypeId in u;
|
|
1254
|
-
}
|
|
1255
|
-
/**
|
|
1256
|
-
* @since 1.18.0
|
|
757
|
+
* @since 1.20.0
|
|
1257
758
|
*/
|
|
1258
759
|
export const matchOption = dual(3, function matchOption(fx, onNone, onSome) {
|
|
1259
760
|
return matchTags(fx, {
|
|
@@ -1262,13 +763,13 @@ export const matchOption = dual(3, function matchOption(fx, onNone, onSome) {
|
|
|
1262
763
|
});
|
|
1263
764
|
});
|
|
1264
765
|
/**
|
|
1265
|
-
* @since 1.
|
|
766
|
+
* @since 1.20.0
|
|
1266
767
|
*/
|
|
1267
768
|
export const getOrElse = dual(2, function getOrElse(fx, orElse) {
|
|
1268
769
|
return matchOption(fx, orElse, identity);
|
|
1269
770
|
});
|
|
1270
771
|
/**
|
|
1271
|
-
* @since 1.
|
|
772
|
+
* @since 1.20.0
|
|
1272
773
|
*/
|
|
1273
774
|
export const matchEither = dual(3, function matchEither(fx, onLeft, onRight) {
|
|
1274
775
|
return matchTags(fx, {
|
|
@@ -1277,28 +778,162 @@ export const matchEither = dual(3, function matchEither(fx, onLeft, onRight) {
|
|
|
1277
778
|
});
|
|
1278
779
|
});
|
|
1279
780
|
/**
|
|
1280
|
-
* @since 1.
|
|
781
|
+
* @since 1.20.0
|
|
782
|
+
*/
|
|
783
|
+
export const at = dual(2, (value, duration) => fromEffect(Effect.delay(Effect.succeed(value), duration)));
|
|
784
|
+
/**
|
|
785
|
+
* @since 1.20.0
|
|
786
|
+
*/
|
|
787
|
+
export function drainLayer(...fxs) {
|
|
788
|
+
return Layer.scopedDiscard(Effect.forkWithErrorHandler(core.drain(core.mergeAll(fxs)), Effect.logError));
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* @since 1.20.0
|
|
1281
792
|
*/
|
|
1282
793
|
export const fork = (fx) => Effect.fork(drain(fx));
|
|
1283
794
|
/**
|
|
1284
|
-
* @since 1.
|
|
795
|
+
* @since 1.20.0
|
|
1285
796
|
*/
|
|
1286
797
|
export const forkScoped = (fx) => Effect.forkScoped(drain(fx));
|
|
1287
798
|
/**
|
|
1288
|
-
* @since 1.
|
|
799
|
+
* @since 1.20.0
|
|
1289
800
|
*/
|
|
1290
801
|
export const forkDaemon = (fx) => Effect.forkDaemon(drain(fx));
|
|
1291
802
|
/**
|
|
1292
|
-
* @since 1.
|
|
803
|
+
* @since 1.20.0
|
|
1293
804
|
*/
|
|
1294
805
|
export const forkIn = dual(2, (fx, scope) => Effect.forkIn(drain(fx), scope));
|
|
1295
806
|
/**
|
|
1296
|
-
* @since 1.
|
|
807
|
+
* @since 1.20.0
|
|
808
|
+
*/
|
|
809
|
+
export const fromAsyncIterable = core.fromAsyncIterable;
|
|
810
|
+
/**
|
|
811
|
+
* @since 1.20.0
|
|
812
|
+
*/
|
|
813
|
+
export const partitionMap = dual(2, function partitionMap(fx, f) {
|
|
814
|
+
const source = coreShare.multicast(core.map(fx, f));
|
|
815
|
+
return [
|
|
816
|
+
core.filterMap(source, Either.getLeft),
|
|
817
|
+
core.filterMap(source, Either.getRight)
|
|
818
|
+
];
|
|
819
|
+
});
|
|
820
|
+
/**
|
|
821
|
+
* @since 1.20.0
|
|
822
|
+
*/
|
|
823
|
+
export const gen = core.gen;
|
|
824
|
+
/**
|
|
825
|
+
* @since 1.20.0
|
|
826
|
+
*/
|
|
827
|
+
export const genScoped = core.genScoped;
|
|
828
|
+
/**
|
|
829
|
+
* @since 1.20.0
|
|
830
|
+
*/
|
|
831
|
+
export const findFirst = dual(2, core.findFirst);
|
|
832
|
+
/**
|
|
833
|
+
* @since 1.20.0
|
|
834
|
+
*/
|
|
835
|
+
export const first = core.first;
|
|
836
|
+
/**
|
|
837
|
+
* @since 1.20.0
|
|
838
|
+
*/
|
|
839
|
+
export const mergeFirst = dual(2, core.mergeFirst);
|
|
840
|
+
/**
|
|
841
|
+
* @since 1.20.0
|
|
842
|
+
*/
|
|
843
|
+
export const mergeRace = dual(2, core.mergeRace);
|
|
844
|
+
/**
|
|
845
|
+
* @since 1.20.0
|
|
846
|
+
*/
|
|
847
|
+
export const raceAll = core.raceAll;
|
|
848
|
+
/**
|
|
849
|
+
* @since 1.20.0
|
|
850
|
+
*/
|
|
851
|
+
export const race = dual(2, core.race);
|
|
852
|
+
/**
|
|
853
|
+
* @since 1.20.0
|
|
854
|
+
*/
|
|
855
|
+
export const snapshot = dual(3, core.snapshot);
|
|
856
|
+
/**
|
|
857
|
+
* @since 1.20.0
|
|
1297
858
|
*/
|
|
1298
|
-
export const
|
|
859
|
+
export const sample = dual(2, core.sample);
|
|
1299
860
|
/**
|
|
861
|
+
* @since 1.20.0
|
|
862
|
+
*/
|
|
863
|
+
export const snapshotEffect = dual(3, core.snapshotEffect);
|
|
864
|
+
const if_ = dual(2, core.if);
|
|
865
|
+
export {
|
|
866
|
+
/**
|
|
867
|
+
* @since 1.20.0
|
|
868
|
+
*/
|
|
869
|
+
if_ as if };
|
|
870
|
+
/**
|
|
871
|
+
* @since 1.20.0
|
|
872
|
+
*/
|
|
873
|
+
export const when = dual(2, core.when);
|
|
874
|
+
/**
|
|
875
|
+
* @since 1.20.0
|
|
876
|
+
*/
|
|
877
|
+
export const withEmitter = (f) => core.make((sink) => Emitter.withEmitter(sink, f));
|
|
878
|
+
/**
|
|
879
|
+
* Create an Fx which will wait a specified duration of time where no
|
|
880
|
+
* events have occurred before emitting a value.
|
|
1300
881
|
* @since 1.18.0
|
|
1301
882
|
*/
|
|
1302
|
-
export
|
|
883
|
+
export const delay = dual(2, function (fx, delay) {
|
|
884
|
+
return core.flatMap(fx, (a) => core.fromEffect(Effect.delay(Effect.succeed(a), delay)));
|
|
885
|
+
});
|
|
886
|
+
/**
|
|
887
|
+
* @since 1.20.0
|
|
888
|
+
*/
|
|
889
|
+
export const ensuring = dual(2, function (self, finalizer) {
|
|
890
|
+
return core.middleware(self, (effect) => Effect.ensuring(effect, finalizer));
|
|
891
|
+
});
|
|
892
|
+
/**
|
|
893
|
+
* @since 1.20.0
|
|
894
|
+
*/
|
|
895
|
+
export const flip = (fx) => core.make((sink) => fx.run(Sink.make((cause) => Either.match(Cause.failureOrCause(cause), {
|
|
896
|
+
onLeft: (e) => sink.onSuccess(e),
|
|
897
|
+
onRight: (c) => sink.onFailure(c)
|
|
898
|
+
}), (a) => sink.onFailure(Cause.fail(a)))));
|
|
899
|
+
/**
|
|
900
|
+
* @since 1.20.0
|
|
901
|
+
*/
|
|
902
|
+
export const fromNullable = (value) => {
|
|
903
|
+
if (value === null || value === undefined) {
|
|
904
|
+
return core.empty;
|
|
905
|
+
}
|
|
906
|
+
else {
|
|
907
|
+
return core.succeed(value);
|
|
908
|
+
}
|
|
909
|
+
};
|
|
910
|
+
export function fromDequeue(dequeue) {
|
|
911
|
+
return core.make((sink) => Effect.repeatWhileEffect(Effect.matchCauseEffect(dequeue.take, sink), () => dequeueIsActive(dequeue)));
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* @internal
|
|
915
|
+
*/
|
|
916
|
+
export function dequeueIsActive(dequeue) {
|
|
917
|
+
if (Queue.DequeueTypeId in dequeue) {
|
|
918
|
+
return Effect.sync(() => dequeue.isActive());
|
|
919
|
+
}
|
|
920
|
+
else {
|
|
921
|
+
return dequeue.isActive;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
export function fromPubSub(pubSub) {
|
|
925
|
+
return core.acquireUseRelease(pubSub.subscribe, (q) => fromDequeue(q), (d) => d.shutdown);
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* @since 1.20.0
|
|
929
|
+
*/
|
|
930
|
+
export class FxEffectBase extends protos.FxEffectBase {
|
|
931
|
+
_fx;
|
|
932
|
+
/**
|
|
933
|
+
* @since 1.20.0
|
|
934
|
+
*/
|
|
935
|
+
run(sink) {
|
|
936
|
+
return (this._fx ||= this.toFx()).run(sink);
|
|
937
|
+
}
|
|
1303
938
|
}
|
|
1304
939
|
//# sourceMappingURL=Fx.js.map
|