@typed/fx 0.0.35 → 1.0.2
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/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +1483 -0
- package/coverage/coverage-final.json +40 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +191 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/src/Fx.ts.html +274 -0
- package/coverage/src/Subject/Subject.ts.html +214 -0
- package/coverage/src/Subject/index.html +116 -0
- package/coverage/src/_internal/RefCounter.ts.html +313 -0
- package/coverage/src/_internal/earlyExit.ts.html +136 -0
- package/coverage/src/_internal/index.html +131 -0
- package/coverage/src/constructor/at.ts.html +118 -0
- package/coverage/src/constructor/fromArray.ts.html +148 -0
- package/coverage/src/constructor/fromEffect.ts.html +148 -0
- package/coverage/src/constructor/fromEmitter.ts.html +265 -0
- package/coverage/src/constructor/fromIterable.ts.html +172 -0
- package/coverage/src/constructor/index.html +236 -0
- package/coverage/src/constructor/never.ts.html +133 -0
- package/coverage/src/constructor/serviceWith.ts.html +118 -0
- package/coverage/src/constructor/succeed.ts.html +139 -0
- package/coverage/src/constructor/suspend.ts.html +130 -0
- package/coverage/src/index.html +116 -0
- package/coverage/src/operator/concatMap.ts.html +112 -0
- package/coverage/src/operator/continueWith.ts.html +169 -0
- package/coverage/src/operator/delay.ts.html +142 -0
- package/coverage/src/operator/filter.ts.html +190 -0
- package/coverage/src/operator/filterEffect.ts.html +214 -0
- package/coverage/src/operator/filterMap.ts.html +190 -0
- package/coverage/src/operator/filterMapEffect.ts.html +217 -0
- package/coverage/src/operator/flatMap.ts.html +211 -0
- package/coverage/src/operator/flatMapConcurrently.ts.html +136 -0
- package/coverage/src/operator/index.html +431 -0
- package/coverage/src/operator/loop.ts.html +214 -0
- package/coverage/src/operator/map.ts.html +163 -0
- package/coverage/src/operator/merge.ts.html +235 -0
- package/coverage/src/operator/multicast.ts.html +424 -0
- package/coverage/src/operator/provideService.ts.html +154 -0
- package/coverage/src/operator/provideServiceEffect.ts.html +190 -0
- package/coverage/src/operator/scan.ts.html +142 -0
- package/coverage/src/operator/scanEffect.ts.html +283 -0
- package/coverage/src/operator/skipRepeats.ts.html +214 -0
- package/coverage/src/operator/slice.ts.html +217 -0
- package/coverage/src/operator/startWith.ts.html +127 -0
- package/coverage/src/operator/switchMap.ts.html +295 -0
- package/coverage/src/operator/withPermit.ts.html +139 -0
- package/coverage/src/run/collectAll.ts.html +136 -0
- package/coverage/src/run/index.html +161 -0
- package/coverage/src/run/observe.ts.html +142 -0
- package/coverage/src/run/reduce.ts.html +145 -0
- package/coverage/src/run/run.ts.html +232 -0
- package/coverage/tmp/coverage-13497-1671499520588-32.json +1 -0
- package/coverage/tmp/coverage-13497-1671499520647-31.json +1 -0
- package/coverage/tmp/coverage-13497-1671499520712-30.json +1 -0
- package/coverage/tmp/coverage-13497-1671499520782-26.json +1 -0
- package/coverage/tmp/coverage-13497-1671499520842-29.json +1 -0
- package/coverage/tmp/coverage-13497-1671499520906-28.json +1 -0
- package/coverage/tmp/coverage-13497-1671499520969-27.json +1 -0
- package/dist/Fx.d.ts +36 -0
- package/dist/Fx.d.ts.map +1 -0
- package/dist/Fx.js +34 -0
- package/dist/Fx.js.map +1 -0
- package/dist/Subject/HoldSubject.d.ts +23 -0
- package/dist/Subject/HoldSubject.d.ts.map +1 -0
- package/dist/Subject/HoldSubject.js +43 -0
- package/dist/Subject/HoldSubject.js.map +1 -0
- package/dist/Subject/RefSubject.d.ts +16 -0
- package/dist/Subject/RefSubject.d.ts.map +1 -0
- package/dist/Subject/RefSubject.js +68 -0
- package/dist/Subject/RefSubject.js.map +1 -0
- package/dist/Subject/Subject.d.ts +18 -0
- package/dist/Subject/Subject.d.ts.map +1 -0
- package/dist/Subject/Subject.js +38 -0
- package/dist/Subject/Subject.js.map +1 -0
- package/dist/Subject/SynchronizedSubject.d.ts +12 -0
- package/dist/Subject/SynchronizedSubject.d.ts.map +1 -0
- package/dist/Subject/SynchronizedSubject.js +82 -0
- package/dist/Subject/SynchronizedSubject.js.map +1 -0
- package/dist/Subject/index.d.ts +5 -0
- package/dist/Subject/index.d.ts.map +1 -0
- package/dist/Subject/index.js +5 -0
- package/dist/Subject/index.js.map +1 -0
- package/dist/_internal/RefCounter.d.ts +21 -0
- package/dist/_internal/RefCounter.d.ts.map +1 -0
- package/dist/_internal/RefCounter.js +40 -0
- package/dist/_internal/RefCounter.js.map +1 -0
- package/dist/_internal/earlyExit.d.ts +3 -0
- package/dist/_internal/earlyExit.d.ts.map +1 -0
- package/dist/_internal/earlyExit.js +6 -0
- package/dist/_internal/earlyExit.js.map +1 -0
- package/dist/_internal/entriesOf.d.ts +2 -0
- package/dist/_internal/entriesOf.d.ts.map +1 -0
- package/dist/_internal/entriesOf.js +4 -0
- package/dist/_internal/entriesOf.js.map +1 -0
- package/dist/constructor/Do.d.ts +2 -0
- package/dist/constructor/Do.d.ts.map +1 -0
- package/dist/constructor/Do.js +3 -0
- package/dist/constructor/Do.js.map +1 -0
- package/dist/constructor/acquireUseRelease.d.ts +4 -0
- package/dist/constructor/acquireUseRelease.d.ts.map +1 -0
- package/dist/constructor/acquireUseRelease.js +16 -0
- package/dist/constructor/acquireUseRelease.js.map +1 -0
- package/dist/constructor/async.d.ts +5 -0
- package/dist/constructor/async.d.ts.map +1 -0
- package/dist/constructor/async.js +5 -0
- package/dist/constructor/async.js.map +1 -0
- package/dist/constructor/asyncEffect.d.ts +4 -0
- package/dist/constructor/asyncEffect.d.ts.map +1 -0
- package/dist/constructor/asyncEffect.js +5 -0
- package/dist/constructor/asyncEffect.js.map +1 -0
- package/dist/constructor/asyncInterrupt.d.ts +5 -0
- package/dist/constructor/asyncInterrupt.d.ts.map +1 -0
- package/dist/constructor/asyncInterrupt.js +4 -0
- package/dist/constructor/asyncInterrupt.js.map +1 -0
- package/dist/constructor/asyncOption.d.ts +6 -0
- package/dist/constructor/asyncOption.d.ts.map +1 -0
- package/dist/constructor/asyncOption.js +5 -0
- package/dist/constructor/asyncOption.js.map +1 -0
- package/dist/constructor/at.d.ts +4 -0
- package/dist/constructor/at.d.ts.map +1 -0
- package/dist/constructor/at.js +7 -0
- package/dist/constructor/at.js.map +1 -0
- package/dist/constructor/die.d.ts +3 -0
- package/dist/constructor/die.d.ts.map +1 -0
- package/dist/constructor/die.js +5 -0
- package/dist/constructor/die.js.map +1 -0
- package/dist/constructor/dieMessage.d.ts +3 -0
- package/dist/constructor/dieMessage.d.ts.map +1 -0
- package/dist/constructor/dieMessage.js +5 -0
- package/dist/constructor/dieMessage.js.map +1 -0
- package/dist/constructor/dieSync.d.ts +3 -0
- package/dist/constructor/dieSync.d.ts.map +1 -0
- package/dist/constructor/dieSync.js +5 -0
- package/dist/constructor/dieSync.js.map +1 -0
- package/dist/constructor/done.d.ts +4 -0
- package/dist/constructor/done.d.ts.map +1 -0
- package/dist/constructor/done.js +17 -0
- package/dist/constructor/done.js.map +1 -0
- package/dist/constructor/empty.d.ts +3 -0
- package/dist/constructor/empty.d.ts.map +1 -0
- package/dist/constructor/empty.js +11 -0
- package/dist/constructor/empty.js.map +1 -0
- package/dist/constructor/fail.d.ts +3 -0
- package/dist/constructor/fail.d.ts.map +1 -0
- package/dist/constructor/fail.js +5 -0
- package/dist/constructor/fail.js.map +1 -0
- package/dist/constructor/failCause.d.ts +4 -0
- package/dist/constructor/failCause.d.ts.map +1 -0
- package/dist/constructor/failCause.js +5 -0
- package/dist/constructor/failCause.js.map +1 -0
- package/dist/constructor/failCauseSync.d.ts +4 -0
- package/dist/constructor/failCauseSync.d.ts.map +1 -0
- package/dist/constructor/failCauseSync.js +5 -0
- package/dist/constructor/failCauseSync.js.map +1 -0
- package/dist/constructor/fromArray.d.ts +3 -0
- package/dist/constructor/fromArray.d.ts.map +1 -0
- package/dist/constructor/fromArray.js +16 -0
- package/dist/constructor/fromArray.js.map +1 -0
- package/dist/constructor/fromEffect.d.ts +4 -0
- package/dist/constructor/fromEffect.d.ts.map +1 -0
- package/dist/constructor/fromEffect.js +16 -0
- package/dist/constructor/fromEffect.js.map +1 -0
- package/dist/constructor/fromEither.d.ts +4 -0
- package/dist/constructor/fromEither.d.ts.map +1 -0
- package/dist/constructor/fromEither.js +5 -0
- package/dist/constructor/fromEither.js.map +1 -0
- package/dist/constructor/fromEitherCause.d.ts +5 -0
- package/dist/constructor/fromEitherCause.d.ts.map +1 -0
- package/dist/constructor/fromEitherCause.js +5 -0
- package/dist/constructor/fromEitherCause.js.map +1 -0
- package/dist/constructor/fromEmitter.d.ts +12 -0
- package/dist/constructor/fromEmitter.d.ts.map +1 -0
- package/dist/constructor/fromEmitter.js +33 -0
- package/dist/constructor/fromEmitter.js.map +1 -0
- package/dist/constructor/fromFiber.d.ts +4 -0
- package/dist/constructor/fromFiber.d.ts.map +1 -0
- package/dist/constructor/fromFiber.js +5 -0
- package/dist/constructor/fromFiber.js.map +1 -0
- package/dist/constructor/fromFiberEffect.d.ts +5 -0
- package/dist/constructor/fromFiberEffect.d.ts.map +1 -0
- package/dist/constructor/fromFiberEffect.js +5 -0
- package/dist/constructor/fromFiberEffect.js.map +1 -0
- package/dist/constructor/fromFxEffect.d.ts +4 -0
- package/dist/constructor/fromFxEffect.d.ts.map +1 -0
- package/dist/constructor/fromFxEffect.js +16 -0
- package/dist/constructor/fromFxEffect.js.map +1 -0
- package/dist/constructor/fromFxEffectGen.d.ts +5 -0
- package/dist/constructor/fromFxEffectGen.d.ts.map +1 -0
- package/dist/constructor/fromFxEffectGen.js +6 -0
- package/dist/constructor/fromFxEffectGen.js.map +1 -0
- package/dist/constructor/fromIterable.d.ts +3 -0
- package/dist/constructor/fromIterable.d.ts.map +1 -0
- package/dist/constructor/fromIterable.js +24 -0
- package/dist/constructor/fromIterable.js.map +1 -0
- package/dist/constructor/fromOption.d.ts +4 -0
- package/dist/constructor/fromOption.d.ts.map +1 -0
- package/dist/constructor/fromOption.js +5 -0
- package/dist/constructor/fromOption.js.map +1 -0
- package/dist/constructor/gen.d.ts +14 -0
- package/dist/constructor/gen.d.ts.map +1 -0
- package/dist/constructor/gen.js +12 -0
- package/dist/constructor/gen.js.map +1 -0
- package/dist/constructor/genFx.d.ts +5 -0
- package/dist/constructor/genFx.d.ts.map +1 -0
- package/dist/constructor/genFx.js +6 -0
- package/dist/constructor/genFx.js.map +1 -0
- package/dist/constructor/index.d.ts +46 -0
- package/dist/constructor/index.d.ts.map +1 -0
- package/dist/constructor/index.js +46 -0
- package/dist/constructor/index.js.map +1 -0
- package/dist/constructor/never.d.ts +3 -0
- package/dist/constructor/never.d.ts.map +1 -0
- package/dist/constructor/never.js +13 -0
- package/dist/constructor/never.js.map +1 -0
- package/dist/constructor/periodic.d.ts +4 -0
- package/dist/constructor/periodic.d.ts.map +1 -0
- package/dist/constructor/periodic.js +9 -0
- package/dist/constructor/periodic.js.map +1 -0
- package/dist/constructor/promise.d.ts +3 -0
- package/dist/constructor/promise.d.ts.map +1 -0
- package/dist/constructor/promise.js +5 -0
- package/dist/constructor/promise.js.map +1 -0
- package/dist/constructor/promiseAbort.d.ts +3 -0
- package/dist/constructor/promiseAbort.d.ts.map +1 -0
- package/dist/constructor/promiseAbort.js +5 -0
- package/dist/constructor/promiseAbort.js.map +1 -0
- package/dist/constructor/promiseFx.d.ts +6 -0
- package/dist/constructor/promiseFx.d.ts.map +1 -0
- package/dist/constructor/promiseFx.js +8 -0
- package/dist/constructor/promiseFx.js.map +1 -0
- package/dist/constructor/random.d.ts +4 -0
- package/dist/constructor/random.d.ts.map +1 -0
- package/dist/constructor/random.js +5 -0
- package/dist/constructor/random.js.map +1 -0
- package/dist/constructor/scheduled.d.ts +12 -0
- package/dist/constructor/scheduled.d.ts.map +1 -0
- package/dist/constructor/scheduled.js +17 -0
- package/dist/constructor/scheduled.js.map +1 -0
- package/dist/constructor/service.d.ts +4 -0
- package/dist/constructor/service.d.ts.map +1 -0
- package/dist/constructor/service.js +5 -0
- package/dist/constructor/service.js.map +1 -0
- package/dist/constructor/serviceWith.d.ts +4 -0
- package/dist/constructor/serviceWith.d.ts.map +1 -0
- package/dist/constructor/serviceWith.js +5 -0
- package/dist/constructor/serviceWith.js.map +1 -0
- package/dist/constructor/serviceWithEffect.d.ts +5 -0
- package/dist/constructor/serviceWithEffect.d.ts.map +1 -0
- package/dist/constructor/serviceWithEffect.js +5 -0
- package/dist/constructor/serviceWithEffect.js.map +1 -0
- package/dist/constructor/serviceWithFx.d.ts +4 -0
- package/dist/constructor/serviceWithFx.d.ts.map +1 -0
- package/dist/constructor/serviceWithFx.js +14 -0
- package/dist/constructor/serviceWithFx.js.map +1 -0
- package/dist/constructor/succeed.d.ts +3 -0
- package/dist/constructor/succeed.d.ts.map +1 -0
- package/dist/constructor/succeed.js +16 -0
- package/dist/constructor/succeed.js.map +1 -0
- package/dist/constructor/suspend.d.ts +3 -0
- package/dist/constructor/suspend.d.ts.map +1 -0
- package/dist/constructor/suspend.js +14 -0
- package/dist/constructor/suspend.js.map +1 -0
- package/dist/constructor/sync.d.ts +3 -0
- package/dist/constructor/sync.d.ts.map +1 -0
- package/dist/constructor/sync.js +5 -0
- package/dist/constructor/sync.js.map +1 -0
- package/dist/constructor/tryCatchPromise.d.ts +3 -0
- package/dist/constructor/tryCatchPromise.d.ts.map +1 -0
- package/dist/constructor/tryCatchPromise.js +5 -0
- package/dist/constructor/tryCatchPromise.js.map +1 -0
- package/dist/constructor/tryCatchPromiseAbort.d.ts +3 -0
- package/dist/constructor/tryCatchPromiseAbort.d.ts.map +1 -0
- package/dist/constructor/tryCatchPromiseAbort.js +5 -0
- package/dist/constructor/tryCatchPromiseAbort.js.map +1 -0
- package/dist/constructor/tryPromise.d.ts +3 -0
- package/dist/constructor/tryPromise.d.ts.map +1 -0
- package/dist/constructor/tryPromise.js +5 -0
- package/dist/constructor/tryPromise.js.map +1 -0
- package/dist/constructor/tryPromiseAbort.d.ts +3 -0
- package/dist/constructor/tryPromiseAbort.d.ts.map +1 -0
- package/dist/constructor/tryPromiseAbort.js +5 -0
- package/dist/constructor/tryPromiseAbort.js.map +1 -0
- package/dist/constructor/unit.d.ts +2 -0
- package/dist/constructor/unit.d.ts.map +1 -0
- package/dist/constructor/unit.js +3 -0
- package/dist/constructor/unit.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/operator/as.d.ts +3 -0
- package/dist/operator/as.d.ts.map +1 -0
- package/dist/operator/as.js +5 -0
- package/dist/operator/as.js.map +1 -0
- package/dist/operator/asUnit.d.ts +2 -0
- package/dist/operator/asUnit.d.ts.map +1 -0
- package/dist/operator/asUnit.js +3 -0
- package/dist/operator/asUnit.js.map +1 -0
- package/dist/operator/catch.d.ts +3 -0
- package/dist/operator/catch.d.ts.map +1 -0
- package/dist/operator/catch.js +9 -0
- package/dist/operator/catch.js.map +1 -0
- package/dist/operator/catchAll.d.ts +3 -0
- package/dist/operator/catchAll.d.ts.map +1 -0
- package/dist/operator/catchAll.js +9 -0
- package/dist/operator/catchAll.js.map +1 -0
- package/dist/operator/catchAllCause.d.ts +4 -0
- package/dist/operator/catchAllCause.d.ts.map +1 -0
- package/dist/operator/catchAllCause.js +24 -0
- package/dist/operator/catchAllCause.js.map +1 -0
- package/dist/operator/catchAllDefect.d.ts +3 -0
- package/dist/operator/catchAllDefect.d.ts.map +1 -0
- package/dist/operator/catchAllDefect.js +9 -0
- package/dist/operator/catchAllDefect.js.map +1 -0
- package/dist/operator/combine.d.ts +6 -0
- package/dist/operator/combine.d.ts.map +1 -0
- package/dist/operator/combine.js +30 -0
- package/dist/operator/combine.js.map +1 -0
- package/dist/operator/compact.d.ts +4 -0
- package/dist/operator/compact.d.ts.map +1 -0
- package/dist/operator/compact.js +4 -0
- package/dist/operator/compact.js.map +1 -0
- package/dist/operator/concatMap.d.ts +3 -0
- package/dist/operator/concatMap.d.ts.map +1 -0
- package/dist/operator/concatMap.js +5 -0
- package/dist/operator/concatMap.js.map +1 -0
- package/dist/operator/continueWith.d.ts +3 -0
- package/dist/operator/continueWith.d.ts.map +1 -0
- package/dist/operator/continueWith.js +25 -0
- package/dist/operator/continueWith.js.map +1 -0
- package/dist/operator/debounce.d.ts +4 -0
- package/dist/operator/debounce.d.ts.map +1 -0
- package/dist/operator/debounce.js +27 -0
- package/dist/operator/debounce.js.map +1 -0
- package/dist/operator/delay.d.ts +4 -0
- package/dist/operator/delay.d.ts.map +1 -0
- package/dist/operator/delay.js +17 -0
- package/dist/operator/delay.js.map +1 -0
- package/dist/operator/during.d.ts +3 -0
- package/dist/operator/during.d.ts.map +1 -0
- package/dist/operator/during.js +30 -0
- package/dist/operator/during.js.map +1 -0
- package/dist/operator/duringEffect.d.ts +2 -0
- package/dist/operator/duringEffect.d.ts.map +1 -0
- package/dist/operator/duringEffect.js +2 -0
- package/dist/operator/duringEffect.js.map +1 -0
- package/dist/operator/exhaustMap.d.ts +3 -0
- package/dist/operator/exhaustMap.d.ts.map +1 -0
- package/dist/operator/exhaustMap.js +24 -0
- package/dist/operator/exhaustMap.js.map +1 -0
- package/dist/operator/exhaustMapEffect.d.ts +4 -0
- package/dist/operator/exhaustMapEffect.d.ts.map +1 -0
- package/dist/operator/exhaustMapEffect.js +7 -0
- package/dist/operator/exhaustMapEffect.js.map +1 -0
- package/dist/operator/exhaustMapLatest.d.ts +3 -0
- package/dist/operator/exhaustMapLatest.d.ts.map +1 -0
- package/dist/operator/exhaustMapLatest.js +30 -0
- package/dist/operator/exhaustMapLatest.js.map +1 -0
- package/dist/operator/exhaustMapLatestEffect.d.ts +4 -0
- package/dist/operator/exhaustMapLatestEffect.d.ts.map +1 -0
- package/dist/operator/exhaustMapLatestEffect.js +7 -0
- package/dist/operator/exhaustMapLatestEffect.js.map +1 -0
- package/dist/operator/filter.d.ts +5 -0
- package/dist/operator/filter.d.ts.map +1 -0
- package/dist/operator/filter.js +32 -0
- package/dist/operator/filter.js.map +1 -0
- package/dist/operator/filterEffect.d.ts +4 -0
- package/dist/operator/filterEffect.d.ts.map +1 -0
- package/dist/operator/filterEffect.js +30 -0
- package/dist/operator/filterEffect.js.map +1 -0
- package/dist/operator/filterMap.d.ts +4 -0
- package/dist/operator/filterMap.d.ts.map +1 -0
- package/dist/operator/filterMap.js +31 -0
- package/dist/operator/filterMap.js.map +1 -0
- package/dist/operator/filterMapEffect.d.ts +5 -0
- package/dist/operator/filterMapEffect.d.ts.map +1 -0
- package/dist/operator/filterMapEffect.js +29 -0
- package/dist/operator/filterMapEffect.js.map +1 -0
- package/dist/operator/flatMap.d.ts +4 -0
- package/dist/operator/flatMap.d.ts.map +1 -0
- package/dist/operator/flatMap.js +19 -0
- package/dist/operator/flatMap.js.map +1 -0
- package/dist/operator/flatMapCause.d.ts +4 -0
- package/dist/operator/flatMapCause.d.ts.map +1 -0
- package/dist/operator/flatMapCause.js +18 -0
- package/dist/operator/flatMapCause.js.map +1 -0
- package/dist/operator/flatMapConcurrently.d.ts +3 -0
- package/dist/operator/flatMapConcurrently.d.ts.map +1 -0
- package/dist/operator/flatMapConcurrently.js +12 -0
- package/dist/operator/flatMapConcurrently.js.map +1 -0
- package/dist/operator/flatMapEffect.d.ts +4 -0
- package/dist/operator/flatMapEffect.d.ts.map +1 -0
- package/dist/operator/flatMapEffect.js +7 -0
- package/dist/operator/flatMapEffect.js.map +1 -0
- package/dist/operator/flatMapEffectConcurrently.d.ts +4 -0
- package/dist/operator/flatMapEffectConcurrently.d.ts.map +1 -0
- package/dist/operator/flatMapEffectConcurrently.js +7 -0
- package/dist/operator/flatMapEffectConcurrently.js.map +1 -0
- package/dist/operator/hold.d.ts +26 -0
- package/dist/operator/hold.d.ts.map +1 -0
- package/dist/operator/hold.js +86 -0
- package/dist/operator/hold.js.map +1 -0
- package/dist/operator/index.d.ts +84 -0
- package/dist/operator/index.d.ts.map +1 -0
- package/dist/operator/index.js +84 -0
- package/dist/operator/index.js.map +1 -0
- package/dist/operator/interruptible.d.ts +3 -0
- package/dist/operator/interruptible.d.ts.map +1 -0
- package/dist/operator/interruptible.js +16 -0
- package/dist/operator/interruptible.js.map +1 -0
- package/dist/operator/loop.d.ts +3 -0
- package/dist/operator/loop.d.ts.map +1 -0
- package/dist/operator/loop.js +32 -0
- package/dist/operator/loop.js.map +1 -0
- package/dist/operator/map.d.ts +3 -0
- package/dist/operator/map.d.ts.map +1 -0
- package/dist/operator/map.js +26 -0
- package/dist/operator/map.js.map +1 -0
- package/dist/operator/mapCause.d.ts +4 -0
- package/dist/operator/mapCause.d.ts.map +1 -0
- package/dist/operator/mapCause.js +19 -0
- package/dist/operator/mapCause.js.map +1 -0
- package/dist/operator/mapError.d.ts +3 -0
- package/dist/operator/mapError.d.ts.map +1 -0
- package/dist/operator/mapError.js +6 -0
- package/dist/operator/mapError.js.map +1 -0
- package/dist/operator/merge.d.ts +4 -0
- package/dist/operator/merge.d.ts.map +1 -0
- package/dist/operator/merge.js +20 -0
- package/dist/operator/merge.js.map +1 -0
- package/dist/operator/multicast.d.ts +29 -0
- package/dist/operator/multicast.d.ts.map +1 -0
- package/dist/operator/multicast.js +69 -0
- package/dist/operator/multicast.js.map +1 -0
- package/dist/operator/onDone.d.ts +4 -0
- package/dist/operator/onDone.d.ts.map +1 -0
- package/dist/operator/onDone.js +9 -0
- package/dist/operator/onDone.js.map +1 -0
- package/dist/operator/onDoneCause.d.ts +5 -0
- package/dist/operator/onDoneCause.d.ts.map +1 -0
- package/dist/operator/onDoneCause.js +19 -0
- package/dist/operator/onDoneCause.js.map +1 -0
- package/dist/operator/onError.d.ts +4 -0
- package/dist/operator/onError.d.ts.map +1 -0
- package/dist/operator/onError.js +6 -0
- package/dist/operator/onError.js.map +1 -0
- package/dist/operator/onExit.d.ts +5 -0
- package/dist/operator/onExit.d.ts.map +1 -0
- package/dist/operator/onExit.js +7 -0
- package/dist/operator/onExit.js.map +1 -0
- package/dist/operator/onInterrupt.d.ts +6 -0
- package/dist/operator/onInterrupt.d.ts.map +1 -0
- package/dist/operator/onInterrupt.js +17 -0
- package/dist/operator/onInterrupt.js.map +1 -0
- package/dist/operator/orDie.d.ts +2 -0
- package/dist/operator/orDie.d.ts.map +1 -0
- package/dist/operator/orDie.js +2 -0
- package/dist/operator/orDie.js.map +1 -0
- package/dist/operator/orDieWith.d.ts +2 -0
- package/dist/operator/orDieWith.d.ts.map +1 -0
- package/dist/operator/orDieWith.js +2 -0
- package/dist/operator/orDieWith.js.map +1 -0
- package/dist/operator/orElse.d.ts +3 -0
- package/dist/operator/orElse.d.ts.map +1 -0
- package/dist/operator/orElse.js +5 -0
- package/dist/operator/orElse.js.map +1 -0
- package/dist/operator/orElseCause.d.ts +2 -0
- package/dist/operator/orElseCause.d.ts.map +1 -0
- package/dist/operator/orElseCause.js +2 -0
- package/dist/operator/orElseCause.js.map +1 -0
- package/dist/operator/orElseEither.d.ts +2 -0
- package/dist/operator/orElseEither.d.ts.map +1 -0
- package/dist/operator/orElseEither.js +2 -0
- package/dist/operator/orElseEither.js.map +1 -0
- package/dist/operator/orElseFail.d.ts +2 -0
- package/dist/operator/orElseFail.d.ts.map +1 -0
- package/dist/operator/orElseFail.js +2 -0
- package/dist/operator/orElseFail.js.map +1 -0
- package/dist/operator/orElseSucceed.d.ts +2 -0
- package/dist/operator/orElseSucceed.d.ts.map +1 -0
- package/dist/operator/orElseSucceed.js +2 -0
- package/dist/operator/orElseSucceed.js.map +1 -0
- package/dist/operator/provideEnvironment.d.ts +4 -0
- package/dist/operator/provideEnvironment.d.ts.map +1 -0
- package/dist/operator/provideEnvironment.js +18 -0
- package/dist/operator/provideEnvironment.js.map +1 -0
- package/dist/operator/provideLayer.d.ts +4 -0
- package/dist/operator/provideLayer.d.ts.map +1 -0
- package/dist/operator/provideLayer.js +6 -0
- package/dist/operator/provideLayer.js.map +1 -0
- package/dist/operator/provideService.d.ts +4 -0
- package/dist/operator/provideService.d.ts.map +1 -0
- package/dist/operator/provideService.js +20 -0
- package/dist/operator/provideService.js.map +1 -0
- package/dist/operator/provideServiceEffect.d.ts +5 -0
- package/dist/operator/provideServiceEffect.d.ts.map +1 -0
- package/dist/operator/provideServiceEffect.js +18 -0
- package/dist/operator/provideServiceEffect.js.map +1 -0
- package/dist/operator/provideSomeEnvironment.d.ts +4 -0
- package/dist/operator/provideSomeEnvironment.d.ts.map +1 -0
- package/dist/operator/provideSomeEnvironment.js +18 -0
- package/dist/operator/provideSomeEnvironment.js.map +1 -0
- package/dist/operator/provideSomeLayer.d.ts +4 -0
- package/dist/operator/provideSomeLayer.d.ts.map +1 -0
- package/dist/operator/provideSomeLayer.js +17 -0
- package/dist/operator/provideSomeLayer.js.map +1 -0
- package/dist/operator/race.d.ts +4 -0
- package/dist/operator/race.d.ts.map +1 -0
- package/dist/operator/race.js +43 -0
- package/dist/operator/race.js.map +1 -0
- package/dist/operator/sample.d.ts +3 -0
- package/dist/operator/sample.d.ts.map +1 -0
- package/dist/operator/sample.js +6 -0
- package/dist/operator/sample.js.map +1 -0
- package/dist/operator/sampleEffect.d.ts +10 -0
- package/dist/operator/sampleEffect.d.ts.map +1 -0
- package/dist/operator/sampleEffect.js +17 -0
- package/dist/operator/sampleEffect.js.map +1 -0
- package/dist/operator/sandbox.d.ts +4 -0
- package/dist/operator/sandbox.d.ts.map +1 -0
- package/dist/operator/sandbox.js +7 -0
- package/dist/operator/sandbox.js.map +1 -0
- package/dist/operator/scan.d.ts +3 -0
- package/dist/operator/scan.d.ts.map +1 -0
- package/dist/operator/scan.js +10 -0
- package/dist/operator/scan.js.map +1 -0
- package/dist/operator/scanEffect.d.ts +4 -0
- package/dist/operator/scanEffect.d.ts.map +1 -0
- package/dist/operator/scanEffect.js +36 -0
- package/dist/operator/scanEffect.js.map +1 -0
- package/dist/operator/separate.d.ts +4 -0
- package/dist/operator/separate.d.ts.map +1 -0
- package/dist/operator/separate.js +13 -0
- package/dist/operator/separate.js.map +1 -0
- package/dist/operator/since.d.ts +3 -0
- package/dist/operator/since.d.ts.map +1 -0
- package/dist/operator/since.js +24 -0
- package/dist/operator/since.js.map +1 -0
- package/dist/operator/skip.d.ts +3 -0
- package/dist/operator/skip.d.ts.map +1 -0
- package/dist/operator/skip.js +3 -0
- package/dist/operator/skip.js.map +1 -0
- package/dist/operator/skipAfter.d.ts +4 -0
- package/dist/operator/skipAfter.d.ts.map +1 -0
- package/dist/operator/skipAfter.js +35 -0
- package/dist/operator/skipAfter.js.map +1 -0
- package/dist/operator/skipAfterEffect.d.ts +2 -0
- package/dist/operator/skipAfterEffect.d.ts.map +1 -0
- package/dist/operator/skipAfterEffect.js +2 -0
- package/dist/operator/skipAfterEffect.js.map +1 -0
- package/dist/operator/skipRepeats.d.ts +4 -0
- package/dist/operator/skipRepeats.d.ts.map +1 -0
- package/dist/operator/skipRepeats.js +34 -0
- package/dist/operator/skipRepeats.js.map +1 -0
- package/dist/operator/skipUntil.d.ts +4 -0
- package/dist/operator/skipUntil.d.ts.map +1 -0
- package/dist/operator/skipUntil.js +32 -0
- package/dist/operator/skipUntil.js.map +1 -0
- package/dist/operator/skipUntilEffect.d.ts +2 -0
- package/dist/operator/skipUntilEffect.d.ts.map +1 -0
- package/dist/operator/skipUntilEffect.js +2 -0
- package/dist/operator/skipUntilEffect.js.map +1 -0
- package/dist/operator/skipWhile.d.ts +4 -0
- package/dist/operator/skipWhile.d.ts.map +1 -0
- package/dist/operator/skipWhile.js +7 -0
- package/dist/operator/skipWhile.js.map +1 -0
- package/dist/operator/skipWhileEffect.d.ts +2 -0
- package/dist/operator/skipWhileEffect.d.ts.map +1 -0
- package/dist/operator/skipWhileEffect.js +2 -0
- package/dist/operator/skipWhileEffect.js.map +1 -0
- package/dist/operator/slice.d.ts +3 -0
- package/dist/operator/slice.d.ts.map +1 -0
- package/dist/operator/slice.js +41 -0
- package/dist/operator/slice.js.map +1 -0
- package/dist/operator/snapshot.d.ts +3 -0
- package/dist/operator/snapshot.d.ts.map +1 -0
- package/dist/operator/snapshot.js +26 -0
- package/dist/operator/snapshot.js.map +1 -0
- package/dist/operator/snapshotEffect.d.ts +4 -0
- package/dist/operator/snapshotEffect.d.ts.map +1 -0
- package/dist/operator/snapshotEffect.js +28 -0
- package/dist/operator/snapshotEffect.js.map +1 -0
- package/dist/operator/startWith.d.ts +3 -0
- package/dist/operator/startWith.d.ts.map +1 -0
- package/dist/operator/startWith.js +7 -0
- package/dist/operator/startWith.js.map +1 -0
- package/dist/operator/startWithEffect.d.ts +4 -0
- package/dist/operator/startWithEffect.d.ts.map +1 -0
- package/dist/operator/startWithEffect.js +17 -0
- package/dist/operator/startWithEffect.js.map +1 -0
- package/dist/operator/struct.d.ts +5 -0
- package/dist/operator/struct.d.ts.map +1 -0
- package/dist/operator/struct.js +8 -0
- package/dist/operator/struct.js.map +1 -0
- package/dist/operator/suceed.d.ts +2 -0
- package/dist/operator/suceed.d.ts.map +1 -0
- package/dist/operator/suceed.js +2 -0
- package/dist/operator/suceed.js.map +1 -0
- package/dist/operator/switchMap.d.ts +4 -0
- package/dist/operator/switchMap.d.ts.map +1 -0
- package/dist/operator/switchMap.js +28 -0
- package/dist/operator/switchMap.js.map +1 -0
- package/dist/operator/switchMapCause.d.ts +4 -0
- package/dist/operator/switchMapCause.d.ts.map +1 -0
- package/dist/operator/switchMapCause.js +27 -0
- package/dist/operator/switchMapCause.js.map +1 -0
- package/dist/operator/switchMapEffect.d.ts +4 -0
- package/dist/operator/switchMapEffect.d.ts.map +1 -0
- package/dist/operator/switchMapEffect.js +7 -0
- package/dist/operator/switchMapEffect.js.map +1 -0
- package/dist/operator/switchMapError.d.ts +5 -0
- package/dist/operator/switchMapError.d.ts.map +1 -0
- package/dist/operator/switchMapError.js +13 -0
- package/dist/operator/switchMapError.js.map +1 -0
- package/dist/operator/switchMatch.d.ts +5 -0
- package/dist/operator/switchMatch.d.ts.map +1 -0
- package/dist/operator/switchMatch.js +37 -0
- package/dist/operator/switchMatch.js.map +1 -0
- package/dist/operator/take.d.ts +3 -0
- package/dist/operator/take.d.ts.map +1 -0
- package/dist/operator/take.js +3 -0
- package/dist/operator/take.js.map +1 -0
- package/dist/operator/takeUntil.d.ts +4 -0
- package/dist/operator/takeUntil.d.ts.map +1 -0
- package/dist/operator/takeUntil.js +31 -0
- package/dist/operator/takeUntil.js.map +1 -0
- package/dist/operator/takeUntilEffect.d.ts +2 -0
- package/dist/operator/takeUntilEffect.d.ts.map +1 -0
- package/dist/operator/takeUntilEffect.js +2 -0
- package/dist/operator/takeUntilEffect.js.map +1 -0
- package/dist/operator/takeWhile.d.ts +4 -0
- package/dist/operator/takeWhile.d.ts.map +1 -0
- package/dist/operator/takeWhile.js +7 -0
- package/dist/operator/takeWhile.js.map +1 -0
- package/dist/operator/takeWhileEffect.d.ts +2 -0
- package/dist/operator/takeWhileEffect.d.ts.map +1 -0
- package/dist/operator/takeWhileEffect.js +2 -0
- package/dist/operator/takeWhileEffect.js.map +1 -0
- package/dist/operator/tap.d.ts +6 -0
- package/dist/operator/tap.d.ts.map +1 -0
- package/dist/operator/tap.js +15 -0
- package/dist/operator/tap.js.map +1 -0
- package/dist/operator/tapCause.d.ts +5 -0
- package/dist/operator/tapCause.d.ts.map +1 -0
- package/dist/operator/tapCause.js +18 -0
- package/dist/operator/tapCause.js.map +1 -0
- package/dist/operator/tapDefect.d.ts +4 -0
- package/dist/operator/tapDefect.d.ts.map +1 -0
- package/dist/operator/tapDefect.js +9 -0
- package/dist/operator/tapDefect.js.map +1 -0
- package/dist/operator/tapError.d.ts +4 -0
- package/dist/operator/tapError.d.ts.map +1 -0
- package/dist/operator/tapError.js +9 -0
- package/dist/operator/tapError.js.map +1 -0
- package/dist/operator/throttle.d.ts +4 -0
- package/dist/operator/throttle.d.ts.map +1 -0
- package/dist/operator/throttle.js +20 -0
- package/dist/operator/throttle.js.map +1 -0
- package/dist/operator/tuple.d.ts +3 -0
- package/dist/operator/tuple.d.ts.map +1 -0
- package/dist/operator/tuple.js +3 -0
- package/dist/operator/tuple.js.map +1 -0
- package/dist/operator/uninterruptible.d.ts +3 -0
- package/dist/operator/uninterruptible.d.ts.map +1 -0
- package/dist/operator/uninterruptible.js +16 -0
- package/dist/operator/uninterruptible.js.map +1 -0
- package/dist/operator/until.d.ts +3 -0
- package/dist/operator/until.d.ts.map +1 -0
- package/dist/operator/until.js +23 -0
- package/dist/operator/until.js.map +1 -0
- package/dist/operator/withItems.d.ts +3 -0
- package/dist/operator/withItems.d.ts.map +1 -0
- package/dist/operator/withItems.js +6 -0
- package/dist/operator/withItems.js.map +1 -0
- package/dist/operator/withPermit.d.ts +4 -0
- package/dist/operator/withPermit.d.ts.map +1 -0
- package/dist/operator/withPermit.js +17 -0
- package/dist/operator/withPermit.js.map +1 -0
- package/dist/operator/withRuntimeFlags.d.ts +4 -0
- package/dist/operator/withRuntimeFlags.d.ts.map +1 -0
- package/dist/operator/withRuntimeFlags.js +17 -0
- package/dist/operator/withRuntimeFlags.js.map +1 -0
- package/dist/operator/zip.d.ts +6 -0
- package/dist/operator/zip.d.ts.map +1 -0
- package/dist/operator/zip.js +32 -0
- package/dist/operator/zip.js.map +1 -0
- package/dist/operator/zipItems.d.ts +3 -0
- package/dist/operator/zipItems.d.ts.map +1 -0
- package/dist/operator/zipItems.js +31 -0
- package/dist/operator/zipItems.js.map +1 -0
- package/dist/run/collectAll.d.ts +4 -0
- package/dist/run/collectAll.d.ts.map +1 -0
- package/dist/run/collectAll.js +8 -0
- package/dist/run/collectAll.js.map +1 -0
- package/dist/run/collectN.d.ts +4 -0
- package/dist/run/collectN.d.ts.map +1 -0
- package/dist/run/collectN.js +9 -0
- package/dist/run/collectN.js.map +1 -0
- package/dist/run/drain.d.ts +4 -0
- package/dist/run/drain.d.ts.map +1 -0
- package/dist/run/drain.js +4 -0
- package/dist/run/drain.js.map +1 -0
- package/dist/run/index.d.ts +8 -0
- package/dist/run/index.d.ts.map +1 -0
- package/dist/run/index.js +8 -0
- package/dist/run/index.js.map +1 -0
- package/dist/run/observe.d.ts +6 -0
- package/dist/run/observe.d.ts.map +1 -0
- package/dist/run/observe.js +10 -0
- package/dist/run/observe.js.map +1 -0
- package/dist/run/reduce.d.ts +4 -0
- package/dist/run/reduce.d.ts.map +1 -0
- package/dist/run/reduce.js +8 -0
- package/dist/run/reduce.js.map +1 -0
- package/dist/run/run.d.ts +7 -0
- package/dist/run/run.d.ts.map +1 -0
- package/dist/run/run.js +19 -0
- package/dist/run/run.js.map +1 -0
- package/dist/run/unsafe.d.ts +15 -0
- package/dist/run/unsafe.d.ts.map +1 -0
- package/dist/run/unsafe.js +11 -0
- package/dist/run/unsafe.js.map +1 -0
- package/dist/typeclass/Alternative.d.ts +5 -0
- package/dist/typeclass/Alternative.d.ts.map +1 -0
- package/dist/typeclass/Alternative.js +11 -0
- package/dist/typeclass/Alternative.js.map +1 -0
- package/dist/typeclass/Applicative.d.ts +4 -0
- package/dist/typeclass/Applicative.d.ts.map +1 -0
- package/dist/typeclass/Applicative.js +9 -0
- package/dist/typeclass/Applicative.js.map +1 -0
- package/dist/typeclass/Bicovariant.d.ts +6 -0
- package/dist/typeclass/Bicovariant.d.ts.map +1 -0
- package/dist/typeclass/Bicovariant.js +9 -0
- package/dist/typeclass/Bicovariant.js.map +1 -0
- package/dist/typeclass/Chainable.d.ts +6 -0
- package/dist/typeclass/Chainable.d.ts.map +1 -0
- package/dist/typeclass/Chainable.js +15 -0
- package/dist/typeclass/Chainable.js.map +1 -0
- package/dist/typeclass/Coproduct.d.ts +5 -0
- package/dist/typeclass/Coproduct.d.ts.map +1 -0
- package/dist/typeclass/Coproduct.js +17 -0
- package/dist/typeclass/Coproduct.js.map +1 -0
- package/dist/typeclass/Covariant.d.ts +11 -0
- package/dist/typeclass/Covariant.d.ts.map +1 -0
- package/dist/typeclass/Covariant.js +8 -0
- package/dist/typeclass/Covariant.js.map +1 -0
- package/dist/typeclass/FlatMap.d.ts +6 -0
- package/dist/typeclass/FlatMap.d.ts.map +1 -0
- package/dist/typeclass/FlatMap.js +13 -0
- package/dist/typeclass/FlatMap.js.map +1 -0
- package/dist/typeclass/Monad.d.ts +6 -0
- package/dist/typeclass/Monad.d.ts.map +1 -0
- package/dist/typeclass/Monad.js +19 -0
- package/dist/typeclass/Monad.js.map +1 -0
- package/dist/typeclass/Of.d.ts +4 -0
- package/dist/typeclass/Of.d.ts.map +1 -0
- package/dist/typeclass/Of.js +5 -0
- package/dist/typeclass/Of.js.map +1 -0
- package/dist/typeclass/Pointed.d.ts +4 -0
- package/dist/typeclass/Pointed.d.ts.map +1 -0
- package/dist/typeclass/Pointed.js +7 -0
- package/dist/typeclass/Pointed.js.map +1 -0
- package/dist/typeclass/Product.d.ts +4 -0
- package/dist/typeclass/Product.d.ts.map +1 -0
- package/dist/typeclass/Product.js +9 -0
- package/dist/typeclass/Product.js.map +1 -0
- package/dist/typeclass/SemiAlternative.d.ts +5 -0
- package/dist/typeclass/SemiAlternative.d.ts.map +1 -0
- package/dist/typeclass/SemiAlternative.js +11 -0
- package/dist/typeclass/SemiAlternative.js.map +1 -0
- package/dist/typeclass/SemiApplicative.d.ts +4 -0
- package/dist/typeclass/SemiApplicative.d.ts.map +1 -0
- package/dist/typeclass/SemiApplicative.js +7 -0
- package/dist/typeclass/SemiApplicative.js.map +1 -0
- package/dist/typeclass/SemiCoproduct.d.ts +5 -0
- package/dist/typeclass/SemiCoproduct.d.ts.map +1 -0
- package/dist/typeclass/SemiCoproduct.js +14 -0
- package/dist/typeclass/SemiCoproduct.js.map +1 -0
- package/dist/typeclass/SemiProduct.d.ts +4 -0
- package/dist/typeclass/SemiProduct.d.ts.map +1 -0
- package/dist/typeclass/SemiProduct.js +9 -0
- package/dist/typeclass/SemiProduct.js.map +1 -0
- package/dist/typeclass/TypeLambda.d.ts +6 -0
- package/dist/typeclass/TypeLambda.d.ts.map +1 -0
- package/dist/typeclass/TypeLambda.js +2 -0
- package/dist/typeclass/TypeLambda.js.map +1 -0
- package/dist/typeclass/index.d.ts +17 -0
- package/dist/typeclass/index.d.ts.map +1 -0
- package/dist/typeclass/index.js +17 -0
- package/dist/typeclass/index.js.map +1 -0
- package/eslintrc.json +3 -0
- package/package.json +20 -621
- package/project.json +26 -0
- package/src/Fx.ts +55 -35
- package/src/Subject/HoldSubject.test.ts +58 -0
- package/src/Subject/HoldSubject.ts +61 -0
- package/src/Subject/RefSubject.ts +99 -0
- package/src/Subject/Subject.test.ts +37 -0
- package/src/Subject/Subject.ts +47 -0
- package/src/Subject/SynchronizedSubject.ts +117 -0
- package/src/Subject/index.ts +4 -0
- package/src/_internal/RefCounter.ts +76 -0
- package/src/_internal/earlyExit.ts +16 -0
- package/src/_internal/entriesOf.ts +3 -0
- package/src/constructor/Do.ts +3 -0
- package/src/constructor/acquireUseRelease.ts +30 -0
- package/src/constructor/async.ts +12 -0
- package/src/constructor/asyncEffect.ts +10 -0
- package/src/constructor/asyncInterrupt.ts +13 -0
- package/src/constructor/asyncOption.ts +13 -0
- package/src/constructor/at.ts +11 -0
- package/src/constructor/die.ts +8 -0
- package/src/constructor/dieMessage.ts +11 -0
- package/src/constructor/dieSync.ts +11 -0
- package/src/constructor/done.ts +19 -0
- package/src/constructor/empty.ts +13 -0
- package/src/constructor/fail.ts +8 -0
- package/src/constructor/failCause.ts +12 -0
- package/src/constructor/failCauseSync.ts +12 -0
- package/src/constructor/fromArray.test.ts +19 -0
- package/src/constructor/fromArray.ts +21 -0
- package/src/constructor/fromEffect.test.ts +19 -0
- package/src/constructor/fromEffect.ts +21 -0
- package/src/constructor/fromEither.ts +12 -0
- package/src/constructor/fromEitherCause.ts +13 -0
- package/src/constructor/fromEmitter.test.ts +28 -0
- package/src/constructor/fromEmitter.ts +61 -0
- package/src/constructor/fromFiber.ts +12 -0
- package/src/constructor/fromFiberEffect.ts +11 -0
- package/src/constructor/fromFxEffect.ts +26 -0
- package/src/constructor/fromIterable.test.ts +19 -0
- package/src/constructor/fromIterable.ts +29 -0
- package/src/constructor/fromOption.ts +12 -0
- package/src/constructor/gen.ts +34 -0
- package/src/constructor/index.ts +45 -0
- package/src/constructor/never.ts +16 -0
- package/src/constructor/periodic.ts +18 -0
- package/src/constructor/promise.ts +11 -0
- package/src/constructor/promiseAbort.ts +10 -0
- package/src/constructor/promiseFx.ts +44 -0
- package/src/constructor/random.ts +9 -0
- package/src/constructor/scheduled.ts +24 -0
- package/src/constructor/service.ts +9 -0
- package/src/constructor/serviceWith.ts +11 -0
- package/src/constructor/serviceWithEffect.ts +12 -0
- package/src/constructor/serviceWithFx.ts +19 -0
- package/src/constructor/succeed.ts +18 -0
- package/src/constructor/suspend.ts +15 -0
- package/src/constructor/sync.ts +8 -0
- package/src/constructor/tryCatchPromise.ts +11 -0
- package/src/constructor/tryCatchPromiseAbort.ts +11 -0
- package/src/constructor/tryPromise.ts +11 -0
- package/src/constructor/tryPromiseAbort.ts +10 -0
- package/src/constructor/unit.ts +3 -0
- package/src/index.ts +9 -51
- package/src/operator/as.ts +7 -0
- package/src/operator/asUnit.ts +3 -0
- package/src/operator/catchAll.ts +16 -0
- package/src/operator/catchAllCause.test.ts +26 -0
- package/src/operator/catchAllCause.ts +31 -0
- package/src/operator/catchAllDefect.ts +22 -0
- package/src/operator/combine.test.ts +35 -0
- package/src/operator/combine.ts +88 -0
- package/src/operator/compact.ts +8 -0
- package/src/operator/concatMap.test.ts +28 -0
- package/src/operator/concatMap.ts +9 -0
- package/src/operator/continueWith.test.ts +25 -0
- package/src/operator/continueWith.ts +28 -0
- package/src/operator/debounce.test.ts +22 -0
- package/src/operator/debounce.ts +58 -0
- package/src/operator/delay.ts +19 -0
- package/src/operator/during.test.ts +48 -0
- package/src/operator/during.ts +62 -0
- package/src/operator/exhaustMap.test.ts +27 -0
- package/src/operator/exhaustMap.ts +63 -0
- package/src/operator/exhaustMapEffect.ts +13 -0
- package/src/operator/exhaustMapLatest.test.ts +27 -0
- package/src/operator/exhaustMapLatest.ts +86 -0
- package/src/operator/exhaustMapLatestEffect.ts +13 -0
- package/src/operator/filter.test.ts +25 -0
- package/src/operator/filter.ts +41 -0
- package/src/operator/filterEffect.test.ts +25 -0
- package/src/operator/filterEffect.ts +43 -0
- package/src/operator/filterMap.test.ts +26 -0
- package/src/operator/filterMap.ts +35 -0
- package/src/operator/filterMapEffect.test.ts +26 -0
- package/src/operator/filterMapEffect.ts +44 -0
- package/src/operator/flatMap.test.ts +38 -0
- package/src/operator/flatMap.ts +45 -0
- package/src/operator/flatMapCause.ts +43 -0
- package/src/operator/flatMapConcurrently.test.ts +28 -0
- package/src/operator/flatMapConcurrently.ts +17 -0
- package/src/operator/flatMapEffect.ts +13 -0
- package/src/operator/flatMapEffectConcurrently.ts +14 -0
- package/src/operator/hold.test.ts +47 -0
- package/src/operator/hold.ts +143 -0
- package/src/operator/index.ts +83 -0
- package/src/operator/interruptible.ts +18 -0
- package/src/operator/loop.test.ts +25 -0
- package/src/operator/loop.ts +43 -0
- package/src/operator/map.test.ts +25 -0
- package/src/operator/map.ts +26 -0
- package/src/operator/mapCause.test.ts +30 -0
- package/src/operator/mapCause.ts +23 -0
- package/src/operator/mapError.ts +9 -0
- package/src/operator/merge.test.ts +31 -0
- package/src/operator/merge.ts +43 -0
- package/src/operator/multicast.test.ts +69 -0
- package/src/operator/multicast.ts +131 -0
- package/src/operator/onDone.ts +19 -0
- package/src/operator/onDoneCause.ts +46 -0
- package/src/operator/onError.ts +11 -0
- package/src/operator/onExit.ts +17 -0
- package/src/operator/onInterrupt.ts +31 -0
- package/src/operator/orElse.ts +9 -0
- package/src/operator/provideEnvironment.ts +23 -0
- package/src/operator/provideLayer.ts +10 -0
- package/src/operator/provideService.test.ts +38 -0
- package/src/operator/provideService.ts +25 -0
- package/src/operator/provideServiceEffect.test.ts +41 -0
- package/src/operator/provideServiceEffect.ts +35 -0
- package/src/operator/provideSomeEnvironment.ts +29 -0
- package/src/operator/provideSomeLayer.ts +26 -0
- package/src/operator/race.test.ts +30 -0
- package/src/operator/race.ts +83 -0
- package/src/operator/sample.ts +10 -0
- package/src/operator/sandbox.ts +11 -0
- package/src/operator/scan.test.ts +25 -0
- package/src/operator/scan.ts +19 -0
- package/src/operator/scanEffect.test.ts +42 -0
- package/src/operator/scanEffect.ts +64 -0
- package/src/operator/separate.test.ts +38 -0
- package/src/operator/separate.ts +27 -0
- package/src/operator/since.test.ts +47 -0
- package/src/operator/since.ts +47 -0
- package/src/operator/skip.ts +6 -0
- package/src/operator/skipAfter.test.ts +29 -0
- package/src/operator/skipAfter.ts +39 -0
- package/src/operator/skipRepeats.test.ts +25 -0
- package/src/operator/skipRepeats.ts +43 -0
- package/src/operator/skipUntil.test.ts +25 -0
- package/src/operator/skipUntil.ts +37 -0
- package/src/operator/skipWhile.ts +10 -0
- package/src/operator/slice.test.ts +21 -0
- package/src/operator/slice.ts +52 -0
- package/src/operator/snapshot.test.ts +27 -0
- package/src/operator/snapshot.ts +55 -0
- package/src/operator/snapshotEffect.test.ts +29 -0
- package/src/operator/snapshotEffect.ts +72 -0
- package/src/operator/startWith.ts +14 -0
- package/src/operator/startWithEffect.ts +32 -0
- package/src/operator/struct.test.ts +38 -0
- package/src/operator/struct.ts +29 -0
- package/src/operator/switchMap.test.ts +27 -0
- package/src/operator/switchMap.ts +72 -0
- package/src/operator/switchMapCause.test.ts +40 -0
- package/src/operator/switchMapCause.ts +70 -0
- package/src/operator/switchMapEffect.ts +13 -0
- package/src/operator/switchMapError.ts +26 -0
- package/src/operator/switchMatch.test.ts +37 -0
- package/src/operator/switchMatch.ts +96 -0
- package/src/operator/take.ts +6 -0
- package/src/operator/takeUntil.test.ts +25 -0
- package/src/operator/takeUntil.ts +41 -0
- package/src/operator/takeWhile.ts +10 -0
- package/src/operator/tap.ts +31 -0
- package/src/operator/tapCause.ts +38 -0
- package/src/operator/tapDefect.ts +22 -0
- package/src/operator/tapError.ts +16 -0
- package/src/operator/throttle.test.ts +22 -0
- package/src/operator/throttle.ts +42 -0
- package/src/operator/tuple.ts +7 -0
- package/src/operator/uninterruptible.ts +18 -0
- package/src/operator/until.test.ts +47 -0
- package/src/operator/until.ts +35 -0
- package/src/operator/withItems.ts +9 -0
- package/src/operator/withPermit.ts +18 -0
- package/src/operator/withRuntimeFlags.ts +19 -0
- package/src/operator/zip.test.ts +30 -0
- package/src/operator/zip.ts +92 -0
- package/src/operator/zipItems.test.ts +25 -0
- package/src/operator/zipItems.ts +36 -0
- package/src/run/collectAll.ts +17 -0
- package/src/run/collectN.ts +21 -0
- package/src/run/drain.ts +7 -0
- package/src/run/index.ts +7 -0
- package/src/run/observe.ts +19 -0
- package/src/run/reduce.ts +20 -0
- package/src/run/run.ts +49 -0
- package/src/run/unsafe.ts +38 -0
- package/src/typeclass/Alternative.ts +15 -0
- package/src/typeclass/Applicative.ts +15 -0
- package/src/typeclass/Bicovariant.ts +15 -0
- package/src/typeclass/Chainable.ts +20 -0
- package/src/typeclass/Coproduct.ts +25 -0
- package/src/typeclass/Covariant.ts +25 -0
- package/src/typeclass/FlatMap.ts +19 -0
- package/src/typeclass/Monad.ts +24 -0
- package/src/typeclass/Of.ts +9 -0
- package/src/typeclass/Pointed.ts +10 -0
- package/src/typeclass/Product.ts +13 -0
- package/src/typeclass/SemiAlternative.ts +15 -0
- package/src/typeclass/SemiApplicative.ts +10 -0
- package/src/typeclass/SemiCoproduct.ts +20 -0
- package/src/typeclass/SemiProduct.ts +12 -0
- package/src/typeclass/TypeLambda.ts +7 -0
- package/src/typeclass/index.ts +16 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +11 -5
- package/.editorconfig +0 -14
- package/.eslintcache +0 -1
- package/.eslintrc.cjs +0 -60
- package/.huskyrc +0 -5
- package/.lintstagedrc +0 -5
- package/.mocharc.json +0 -6
- package/.nvmrc +0 -1
- package/.pnpm-debug.log +0 -20
- package/.prettierrc.cjs +0 -11
- package/.vscode/settings.json +0 -7
- package/cjs/Fx.d.ts +0 -27
- package/cjs/Fx.d.ts.map +0 -1
- package/cjs/Fx.js +0 -18
- package/cjs/Fx.js.map +0 -1
- package/cjs/Subject.d.ts +0 -37
- package/cjs/Subject.d.ts.map +0 -1
- package/cjs/Subject.js +0 -193
- package/cjs/Subject.js.map +0 -1
- package/cjs/_internal.d.ts +0 -21
- package/cjs/_internal.d.ts.map +0 -1
- package/cjs/_internal.js +0 -61
- package/cjs/_internal.js.map +0 -1
- package/cjs/combine.d.ts +0 -7
- package/cjs/combine.d.ts.map +0 -1
- package/cjs/combine.js +0 -49
- package/cjs/combine.js.map +0 -1
- package/cjs/continueWith.d.ts +0 -4
- package/cjs/continueWith.d.ts.map +0 -1
- package/cjs/continueWith.js +0 -38
- package/cjs/continueWith.js.map +0 -1
- package/cjs/debounce.d.ts +0 -4
- package/cjs/debounce.d.ts.map +0 -1
- package/cjs/debounce.js +0 -40
- package/cjs/debounce.js.map +0 -1
- package/cjs/delay.d.ts +0 -5
- package/cjs/delay.d.ts.map +0 -1
- package/cjs/delay.js +0 -39
- package/cjs/delay.js.map +0 -1
- package/cjs/during.d.ts +0 -3
- package/cjs/during.d.ts.map +0 -1
- package/cjs/during.js +0 -40
- package/cjs/during.js.map +0 -1
- package/cjs/exhaustMap.d.ts +0 -3
- package/cjs/exhaustMap.d.ts.map +0 -1
- package/cjs/exhaustMap.js +0 -38
- package/cjs/exhaustMap.js.map +0 -1
- package/cjs/exhaustMapLatest.d.ts +0 -3
- package/cjs/exhaustMapLatest.d.ts.map +0 -1
- package/cjs/exhaustMapLatest.js +0 -44
- package/cjs/exhaustMapLatest.js.map +0 -1
- package/cjs/exhaustMapList.d.ts +0 -3
- package/cjs/exhaustMapList.d.ts.map +0 -1
- package/cjs/exhaustMapList.js +0 -70
- package/cjs/exhaustMapList.js.map +0 -1
- package/cjs/filterLoop.d.ts +0 -31
- package/cjs/filterLoop.d.ts.map +0 -1
- package/cjs/filterLoop.js +0 -114
- package/cjs/filterLoop.js.map +0 -1
- package/cjs/filterMap.d.ts +0 -30
- package/cjs/filterMap.d.ts.map +0 -1
- package/cjs/filterMap.js +0 -91
- package/cjs/filterMap.js.map +0 -1
- package/cjs/flatMap.d.ts +0 -4
- package/cjs/flatMap.d.ts.map +0 -1
- package/cjs/flatMap.js +0 -43
- package/cjs/flatMap.js.map +0 -1
- package/cjs/flatMapConcurrently.d.ts +0 -4
- package/cjs/flatMapConcurrently.d.ts.map +0 -1
- package/cjs/flatMapConcurrently.js +0 -40
- package/cjs/flatMapConcurrently.js.map +0 -1
- package/cjs/fromDequeue.d.ts +0 -4
- package/cjs/fromDequeue.d.ts.map +0 -1
- package/cjs/fromDequeue.js +0 -39
- package/cjs/fromDequeue.js.map +0 -1
- package/cjs/fromEffect.d.ts +0 -47
- package/cjs/fromEffect.d.ts.map +0 -1
- package/cjs/fromEffect.js +0 -70
- package/cjs/fromEffect.js.map +0 -1
- package/cjs/fromFxEffect.d.ts +0 -9
- package/cjs/fromFxEffect.d.ts.map +0 -1
- package/cjs/fromFxEffect.js +0 -38
- package/cjs/fromFxEffect.js.map +0 -1
- package/cjs/fromHub.d.ts +0 -4
- package/cjs/fromHub.d.ts.map +0 -1
- package/cjs/fromHub.js +0 -36
- package/cjs/fromHub.js.map +0 -1
- package/cjs/fromIterable.d.ts +0 -12
- package/cjs/fromIterable.d.ts.map +0 -1
- package/cjs/fromIterable.js +0 -45
- package/cjs/fromIterable.js.map +0 -1
- package/cjs/hold.d.ts +0 -26
- package/cjs/hold.d.ts.map +0 -1
- package/cjs/hold.js +0 -109
- package/cjs/hold.js.map +0 -1
- package/cjs/index.d.ts +0 -53
- package/cjs/index.d.ts.map +0 -1
- package/cjs/index.js +0 -69
- package/cjs/index.js.map +0 -1
- package/cjs/mapCause.d.ts +0 -5
- package/cjs/mapCause.d.ts.map +0 -1
- package/cjs/mapCause.js +0 -41
- package/cjs/mapCause.js.map +0 -1
- package/cjs/mapEffect.d.ts +0 -4
- package/cjs/mapEffect.d.ts.map +0 -1
- package/cjs/mapEffect.js +0 -32
- package/cjs/mapEffect.js.map +0 -1
- package/cjs/merge.d.ts +0 -5
- package/cjs/merge.d.ts.map +0 -1
- package/cjs/merge.js +0 -44
- package/cjs/merge.js.map +0 -1
- package/cjs/multicast.d.ts +0 -31
- package/cjs/multicast.d.ts.map +0 -1
- package/cjs/multicast.js +0 -83
- package/cjs/multicast.js.map +0 -1
- package/cjs/on.d.ts +0 -10
- package/cjs/on.d.ts.map +0 -1
- package/cjs/on.js +0 -38
- package/cjs/on.js.map +0 -1
- package/cjs/orElse.d.ts +0 -5
- package/cjs/orElse.d.ts.map +0 -1
- package/cjs/orElse.js +0 -47
- package/cjs/orElse.js.map +0 -1
- package/cjs/periodic.d.ts +0 -4
- package/cjs/periodic.d.ts.map +0 -1
- package/cjs/periodic.js +0 -35
- package/cjs/periodic.js.map +0 -1
- package/cjs/provide.d.ts +0 -12
- package/cjs/provide.d.ts.map +0 -1
- package/cjs/provide.js +0 -56
- package/cjs/provide.js.map +0 -1
- package/cjs/runCollect.d.ts +0 -4
- package/cjs/runCollect.d.ts.map +0 -1
- package/cjs/runCollect.js +0 -35
- package/cjs/runCollect.js.map +0 -1
- package/cjs/runDrain.d.ts +0 -4
- package/cjs/runDrain.d.ts.map +0 -1
- package/cjs/runDrain.js +0 -39
- package/cjs/runDrain.js.map +0 -1
- package/cjs/runObserve.d.ts +0 -4
- package/cjs/runObserve.d.ts.map +0 -1
- package/cjs/runObserve.js +0 -36
- package/cjs/runObserve.js.map +0 -1
- package/cjs/runReduce.d.ts +0 -6
- package/cjs/runReduce.d.ts.map +0 -1
- package/cjs/runReduce.js +0 -50
- package/cjs/runReduce.js.map +0 -1
- package/cjs/scanEffect.d.ts +0 -4
- package/cjs/scanEffect.d.ts.map +0 -1
- package/cjs/scanEffect.js +0 -35
- package/cjs/scanEffect.js.map +0 -1
- package/cjs/scheduled.d.ts +0 -14
- package/cjs/scheduled.d.ts.map +0 -1
- package/cjs/scheduled.js +0 -81
- package/cjs/scheduled.js.map +0 -1
- package/cjs/since.d.ts +0 -3
- package/cjs/since.d.ts.map +0 -1
- package/cjs/since.js +0 -39
- package/cjs/since.js.map +0 -1
- package/cjs/skipRepeats.d.ts +0 -4
- package/cjs/skipRepeats.d.ts.map +0 -1
- package/cjs/skipRepeats.js +0 -40
- package/cjs/skipRepeats.js.map +0 -1
- package/cjs/skipWhile.d.ts +0 -5
- package/cjs/skipWhile.d.ts.map +0 -1
- package/cjs/skipWhile.js +0 -48
- package/cjs/skipWhile.js.map +0 -1
- package/cjs/slice.d.ts +0 -5
- package/cjs/slice.d.ts.map +0 -1
- package/cjs/slice.js +0 -55
- package/cjs/slice.js.map +0 -1
- package/cjs/snapshot.d.ts +0 -4
- package/cjs/snapshot.d.ts.map +0 -1
- package/cjs/snapshot.js +0 -43
- package/cjs/snapshot.js.map +0 -1
- package/cjs/struct.d.ts +0 -3
- package/cjs/struct.d.ts.map +0 -1
- package/cjs/struct.js +0 -9
- package/cjs/struct.js.map +0 -1
- package/cjs/suspendSucceed.d.ts +0 -3
- package/cjs/suspendSucceed.d.ts.map +0 -1
- package/cjs/suspendSucceed.js +0 -9
- package/cjs/suspendSucceed.js.map +0 -1
- package/cjs/switchMap.d.ts +0 -3
- package/cjs/switchMap.d.ts.map +0 -1
- package/cjs/switchMap.js +0 -37
- package/cjs/switchMap.js.map +0 -1
- package/cjs/takeWhile.d.ts +0 -5
- package/cjs/takeWhile.d.ts.map +0 -1
- package/cjs/takeWhile.js +0 -19
- package/cjs/takeWhile.js.map +0 -1
- package/cjs/tapEffect.d.ts +0 -5
- package/cjs/tapEffect.d.ts.map +0 -1
- package/cjs/tapEffect.js +0 -34
- package/cjs/tapEffect.js.map +0 -1
- package/cjs/throttle.d.ts +0 -4
- package/cjs/throttle.d.ts.map +0 -1
- package/cjs/throttle.js +0 -41
- package/cjs/throttle.js.map +0 -1
- package/cjs/toEnqueue.d.ts +0 -5
- package/cjs/toEnqueue.d.ts.map +0 -1
- package/cjs/toEnqueue.js +0 -9
- package/cjs/toEnqueue.js.map +0 -1
- package/cjs/toStream.d.ts +0 -8
- package/cjs/toStream.d.ts.map +0 -1
- package/cjs/toStream.js +0 -64
- package/cjs/toStream.js.map +0 -1
- package/cjs/transform.d.ts +0 -20
- package/cjs/transform.d.ts.map +0 -1
- package/cjs/transform.js +0 -54
- package/cjs/transform.js.map +0 -1
- package/cjs/until.d.ts +0 -3
- package/cjs/until.d.ts.map +0 -1
- package/cjs/until.js +0 -39
- package/cjs/until.js.map +0 -1
- package/cjs/withEmitter.d.ts +0 -5
- package/cjs/withEmitter.d.ts.map +0 -1
- package/cjs/withEmitter.js +0 -47
- package/cjs/withEmitter.js.map +0 -1
- package/cjs/zip.d.ts +0 -7
- package/cjs/zip.d.ts.map +0 -1
- package/cjs/zip.js +0 -51
- package/cjs/zip.js.map +0 -1
- package/cjs/zipIterable.d.ts +0 -4
- package/cjs/zipIterable.d.ts.map +0 -1
- package/cjs/zipIterable.js +0 -54
- package/cjs/zipIterable.js.map +0 -1
- package/esm/Fx.d.ts +0 -27
- package/esm/Fx.d.ts.map +0 -1
- package/esm/Fx.js +0 -13
- package/esm/Fx.js.map +0 -1
- package/esm/Subject.d.ts +0 -37
- package/esm/Subject.d.ts.map +0 -1
- package/esm/Subject.js +0 -163
- package/esm/Subject.js.map +0 -1
- package/esm/_internal.d.ts +0 -21
- package/esm/_internal.d.ts.map +0 -1
- package/esm/_internal.js +0 -31
- package/esm/_internal.js.map +0 -1
- package/esm/combine.d.ts +0 -7
- package/esm/combine.d.ts.map +0 -1
- package/esm/combine.js +0 -21
- package/esm/combine.js.map +0 -1
- package/esm/continueWith.d.ts +0 -4
- package/esm/continueWith.d.ts.map +0 -1
- package/esm/continueWith.js +0 -10
- package/esm/continueWith.js.map +0 -1
- package/esm/debounce.d.ts +0 -4
- package/esm/debounce.d.ts.map +0 -1
- package/esm/debounce.js +0 -13
- package/esm/debounce.js.map +0 -1
- package/esm/delay.d.ts +0 -5
- package/esm/delay.d.ts.map +0 -1
- package/esm/delay.js +0 -11
- package/esm/delay.js.map +0 -1
- package/esm/during.d.ts +0 -3
- package/esm/during.d.ts.map +0 -1
- package/esm/during.js +0 -13
- package/esm/during.js.map +0 -1
- package/esm/exhaustMap.d.ts +0 -3
- package/esm/exhaustMap.d.ts.map +0 -1
- package/esm/exhaustMap.js +0 -11
- package/esm/exhaustMap.js.map +0 -1
- package/esm/exhaustMapLatest.d.ts +0 -3
- package/esm/exhaustMapLatest.d.ts.map +0 -1
- package/esm/exhaustMapLatest.js +0 -17
- package/esm/exhaustMapLatest.js.map +0 -1
- package/esm/exhaustMapList.d.ts +0 -3
- package/esm/exhaustMapList.d.ts.map +0 -1
- package/esm/exhaustMapList.js +0 -43
- package/esm/exhaustMapList.js.map +0 -1
- package/esm/filterLoop.d.ts +0 -31
- package/esm/filterLoop.d.ts.map +0 -1
- package/esm/filterLoop.js +0 -82
- package/esm/filterLoop.js.map +0 -1
- package/esm/filterMap.d.ts +0 -30
- package/esm/filterMap.d.ts.map +0 -1
- package/esm/filterMap.js +0 -59
- package/esm/filterMap.js.map +0 -1
- package/esm/flatMap.d.ts +0 -4
- package/esm/flatMap.d.ts.map +0 -1
- package/esm/flatMap.js +0 -15
- package/esm/flatMap.js.map +0 -1
- package/esm/flatMapConcurrently.d.ts +0 -4
- package/esm/flatMapConcurrently.d.ts.map +0 -1
- package/esm/flatMapConcurrently.js +0 -12
- package/esm/flatMapConcurrently.js.map +0 -1
- package/esm/fromDequeue.d.ts +0 -4
- package/esm/fromDequeue.d.ts.map +0 -1
- package/esm/fromDequeue.js +0 -12
- package/esm/fromDequeue.js.map +0 -1
- package/esm/fromEffect.d.ts +0 -47
- package/esm/fromEffect.d.ts.map +0 -1
- package/esm/fromEffect.js +0 -40
- package/esm/fromEffect.js.map +0 -1
- package/esm/fromFxEffect.d.ts +0 -9
- package/esm/fromFxEffect.d.ts.map +0 -1
- package/esm/fromFxEffect.js +0 -10
- package/esm/fromFxEffect.js.map +0 -1
- package/esm/fromHub.d.ts +0 -4
- package/esm/fromHub.d.ts.map +0 -1
- package/esm/fromHub.js +0 -9
- package/esm/fromHub.js.map +0 -1
- package/esm/fromIterable.d.ts +0 -12
- package/esm/fromIterable.d.ts.map +0 -1
- package/esm/fromIterable.js +0 -17
- package/esm/fromIterable.js.map +0 -1
- package/esm/hold.d.ts +0 -26
- package/esm/hold.d.ts.map +0 -1
- package/esm/hold.js +0 -81
- package/esm/hold.js.map +0 -1
- package/esm/index.d.ts +0 -53
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -53
- package/esm/index.js.map +0 -1
- package/esm/mapCause.d.ts +0 -5
- package/esm/mapCause.d.ts.map +0 -1
- package/esm/mapCause.js +0 -13
- package/esm/mapCause.js.map +0 -1
- package/esm/mapEffect.d.ts +0 -4
- package/esm/mapEffect.d.ts.map +0 -1
- package/esm/mapEffect.js +0 -5
- package/esm/mapEffect.js.map +0 -1
- package/esm/merge.d.ts +0 -5
- package/esm/merge.d.ts.map +0 -1
- package/esm/merge.js +0 -16
- package/esm/merge.js.map +0 -1
- package/esm/multicast.d.ts +0 -31
- package/esm/multicast.d.ts.map +0 -1
- package/esm/multicast.js +0 -55
- package/esm/multicast.js.map +0 -1
- package/esm/on.d.ts +0 -10
- package/esm/on.d.ts.map +0 -1
- package/esm/on.js +0 -8
- package/esm/on.js.map +0 -1
- package/esm/orElse.d.ts +0 -5
- package/esm/orElse.d.ts.map +0 -1
- package/esm/orElse.js +0 -19
- package/esm/orElse.js.map +0 -1
- package/esm/periodic.d.ts +0 -4
- package/esm/periodic.d.ts.map +0 -1
- package/esm/periodic.js +0 -8
- package/esm/periodic.js.map +0 -1
- package/esm/provide.d.ts +0 -12
- package/esm/provide.d.ts.map +0 -1
- package/esm/provide.js +0 -24
- package/esm/provide.js.map +0 -1
- package/esm/runCollect.d.ts +0 -4
- package/esm/runCollect.d.ts.map +0 -1
- package/esm/runCollect.js +0 -8
- package/esm/runCollect.js.map +0 -1
- package/esm/runDrain.d.ts +0 -4
- package/esm/runDrain.d.ts.map +0 -1
- package/esm/runDrain.js +0 -12
- package/esm/runDrain.js.map +0 -1
- package/esm/runObserve.d.ts +0 -4
- package/esm/runObserve.d.ts.map +0 -1
- package/esm/runObserve.js +0 -9
- package/esm/runObserve.js.map +0 -1
- package/esm/runReduce.d.ts +0 -6
- package/esm/runReduce.d.ts.map +0 -1
- package/esm/runReduce.js +0 -22
- package/esm/runReduce.js.map +0 -1
- package/esm/scanEffect.d.ts +0 -4
- package/esm/scanEffect.d.ts.map +0 -1
- package/esm/scanEffect.js +0 -8
- package/esm/scanEffect.js.map +0 -1
- package/esm/scheduled.d.ts +0 -14
- package/esm/scheduled.d.ts.map +0 -1
- package/esm/scheduled.js +0 -53
- package/esm/scheduled.js.map +0 -1
- package/esm/since.d.ts +0 -3
- package/esm/since.d.ts.map +0 -1
- package/esm/since.js +0 -12
- package/esm/since.js.map +0 -1
- package/esm/skipRepeats.d.ts +0 -4
- package/esm/skipRepeats.d.ts.map +0 -1
- package/esm/skipRepeats.js +0 -13
- package/esm/skipRepeats.js.map +0 -1
- package/esm/skipWhile.d.ts +0 -5
- package/esm/skipWhile.d.ts.map +0 -1
- package/esm/skipWhile.js +0 -20
- package/esm/skipWhile.js.map +0 -1
- package/esm/slice.d.ts +0 -5
- package/esm/slice.d.ts.map +0 -1
- package/esm/slice.js +0 -26
- package/esm/slice.js.map +0 -1
- package/esm/snapshot.d.ts +0 -4
- package/esm/snapshot.d.ts.map +0 -1
- package/esm/snapshot.js +0 -15
- package/esm/snapshot.js.map +0 -1
- package/esm/struct.d.ts +0 -3
- package/esm/struct.d.ts.map +0 -1
- package/esm/struct.js +0 -5
- package/esm/struct.js.map +0 -1
- package/esm/suspendSucceed.d.ts +0 -3
- package/esm/suspendSucceed.d.ts.map +0 -1
- package/esm/suspendSucceed.js +0 -5
- package/esm/suspendSucceed.js.map +0 -1
- package/esm/switchMap.d.ts +0 -3
- package/esm/switchMap.d.ts.map +0 -1
- package/esm/switchMap.js +0 -10
- package/esm/switchMap.js.map +0 -1
- package/esm/takeWhile.d.ts +0 -5
- package/esm/takeWhile.d.ts.map +0 -1
- package/esm/takeWhile.js +0 -14
- package/esm/takeWhile.js.map +0 -1
- package/esm/tapEffect.d.ts +0 -5
- package/esm/tapEffect.d.ts.map +0 -1
- package/esm/tapEffect.js +0 -6
- package/esm/tapEffect.js.map +0 -1
- package/esm/throttle.d.ts +0 -4
- package/esm/throttle.d.ts.map +0 -1
- package/esm/throttle.js +0 -14
- package/esm/throttle.js.map +0 -1
- package/esm/toEnqueue.d.ts +0 -5
- package/esm/toEnqueue.d.ts.map +0 -1
- package/esm/toEnqueue.js +0 -5
- package/esm/toEnqueue.js.map +0 -1
- package/esm/toStream.d.ts +0 -8
- package/esm/toStream.d.ts.map +0 -1
- package/esm/toStream.js +0 -37
- package/esm/toStream.js.map +0 -1
- package/esm/transform.d.ts +0 -20
- package/esm/transform.d.ts.map +0 -1
- package/esm/transform.js +0 -20
- package/esm/transform.js.map +0 -1
- package/esm/until.d.ts +0 -3
- package/esm/until.d.ts.map +0 -1
- package/esm/until.js +0 -12
- package/esm/until.js.map +0 -1
- package/esm/withEmitter.d.ts +0 -5
- package/esm/withEmitter.d.ts.map +0 -1
- package/esm/withEmitter.js +0 -20
- package/esm/withEmitter.js.map +0 -1
- package/esm/zip.d.ts +0 -7
- package/esm/zip.d.ts.map +0 -1
- package/esm/zip.js +0 -23
- package/esm/zip.js.map +0 -1
- package/esm/zipIterable.d.ts +0 -4
- package/esm/zipIterable.d.ts.map +0 -1
- package/esm/zipIterable.js +0 -26
- package/esm/zipIterable.js.map +0 -1
- package/perf/cases/filter-map-reduce.ts +0 -51
- package/perf/cases/flatMap.ts +0 -47
- package/perf/cases/switchMap.ts +0 -40
- package/perf/helpers.ts +0 -60
- package/perf/readme.md +0 -29
- package/perf/runPerfTest.ts +0 -25
- package/readme.md +0 -7
- package/src/Subject.test.ts +0 -95
- package/src/Subject.ts +0 -230
- package/src/_internal.ts +0 -72
- package/src/combine.test.ts +0 -34
- package/src/combine.ts +0 -66
- package/src/continueWith.test.ts +0 -26
- package/src/continueWith.ts +0 -21
- package/src/debounce.test.ts +0 -17
- package/src/debounce.ts +0 -49
- package/src/delay.test.ts +0 -24
- package/src/delay.ts +0 -17
- package/src/during.test.ts +0 -39
- package/src/during.ts +0 -54
- package/src/exhaustMap.test.ts +0 -34
- package/src/exhaustMap.ts +0 -49
- package/src/exhaustMapLatest.test.ts +0 -34
- package/src/exhaustMapLatest.ts +0 -59
- package/src/exhaustMapList.test.ts +0 -64
- package/src/exhaustMapList.ts +0 -144
- package/src/filterLoop.test.ts +0 -63
- package/src/filterLoop.ts +0 -151
- package/src/filterMap.test.ts +0 -33
- package/src/filterMap.ts +0 -79
- package/src/flatMap.test.ts +0 -50
- package/src/flatMap.ts +0 -43
- package/src/flatMapConcurrently.test.ts +0 -23
- package/src/flatMapConcurrently.ts +0 -16
- package/src/fromDequeue.ts +0 -17
- package/src/fromEffect.ts +0 -112
- package/src/fromFxEffect.ts +0 -31
- package/src/fromHub.ts +0 -12
- package/src/fromIterable.ts +0 -19
- package/src/hold.test.ts +0 -49
- package/src/hold.ts +0 -142
- package/src/mapCause.test.ts +0 -34
- package/src/mapCause.ts +0 -19
- package/src/mapEffect.test.ts +0 -21
- package/src/mapEffect.ts +0 -17
- package/src/merge.test.ts +0 -21
- package/src/merge.ts +0 -33
- package/src/multicast.test.ts +0 -52
- package/src/multicast.ts +0 -116
- package/src/on.ts +0 -33
- package/src/orElse.test.ts +0 -22
- package/src/orElse.ts +0 -33
- package/src/periodic.test.ts +0 -20
- package/src/periodic.ts +0 -11
- package/src/provide.test.ts +0 -56
- package/src/provide.ts +0 -61
- package/src/runCollect.ts +0 -21
- package/src/runDrain.ts +0 -25
- package/src/runObserve.ts +0 -33
- package/src/runReduce.ts +0 -64
- package/src/scanEffect.ts +0 -32
- package/src/scheduled.ts +0 -79
- package/src/since.test.ts +0 -40
- package/src/since.ts +0 -30
- package/src/skipRepeats.test.ts +0 -28
- package/src/skipRepeats.ts +0 -33
- package/src/skipWhile.test.ts +0 -44
- package/src/skipWhile.ts +0 -45
- package/src/slice.test.ts +0 -21
- package/src/slice.ts +0 -47
- package/src/snapshot.test.ts +0 -51
- package/src/snapshot.ts +0 -54
- package/src/struct.ts +0 -24
- package/src/suspendSucceed.ts +0 -5
- package/src/switchMap.test.ts +0 -35
- package/src/switchMap.ts +0 -46
- package/src/takeWhile.test.ts +0 -44
- package/src/takeWhile.ts +0 -28
- package/src/tapEffect.ts +0 -24
- package/src/throttle.test.ts +0 -17
- package/src/throttle.ts +0 -53
- package/src/toEnqueue.ts +0 -9
- package/src/toStream.ts +0 -81
- package/src/transform.ts +0 -44
- package/src/until.test.ts +0 -35
- package/src/until.ts +0 -27
- package/src/withEmitter.test.ts +0 -28
- package/src/withEmitter.ts +0 -39
- package/src/zip.test.ts +0 -31
- package/src/zip.ts +0 -70
- package/src/zipIterable.test.ts +0 -19
- package/src/zipIterable.ts +0 -51
- package/tools/benchmark.ts +0 -159
- package/tools/common.ts +0 -43
- package/tools/generatePackageExports.ts +0 -100
- package/tsconfig.base.json +0 -33
- package/tsconfig.build.cjs.json +0 -32
- package/tsconfig.build.esm.json +0 -36
- package/tsconfig.test.json +0 -17
package/src/Fx.ts
CHANGED
|
@@ -1,51 +1,71 @@
|
|
|
1
|
-
import { Cause } from '@effect/
|
|
2
|
-
import
|
|
3
|
-
import { Scope } from '@effect/
|
|
1
|
+
import { Cause } from '@effect/io/Cause'
|
|
2
|
+
import { Effect } from '@effect/io/Effect'
|
|
3
|
+
import { Scope } from '@effect/io/Scope'
|
|
4
|
+
import { identity } from '@fp-ts/data/Function'
|
|
4
5
|
|
|
5
|
-
export interface Fx<R, E, A> {
|
|
6
|
-
readonly
|
|
7
|
-
readonly _E: () => E
|
|
8
|
-
readonly _A: () => A
|
|
9
|
-
|
|
10
|
-
run<R2>(emitter: Emitter<R2, E, A>): Effect.Effect<R | R2 | Scope, never, unknown>
|
|
6
|
+
export interface Fx<R, E, A> extends Fx.Variance<R, E, A> {
|
|
7
|
+
readonly run: <R2>(sink: Fx.Sink<R2, E, A>) => Effect<R | R2 | Scope, never, unknown>
|
|
11
8
|
}
|
|
12
9
|
|
|
13
|
-
export function Fx<R, E, A>(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export function Fx<R, E, A>(
|
|
11
|
+
run: <R2>(sink: Fx.Sink<R2, E, A>) => Effect<R | R2 | Scope, never, unknown>,
|
|
12
|
+
): Fx<R, E, A> {
|
|
13
|
+
return new (class extends Fx.Variance<R, E, A> {
|
|
14
|
+
readonly run = run
|
|
15
|
+
})()
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export namespace Fx {
|
|
19
|
+
export const TypeId = Symbol.for('@typed/fx/Fx')
|
|
20
|
+
export type TypeId = typeof TypeId
|
|
21
|
+
|
|
22
|
+
export abstract class Variance<R, E, A> {
|
|
23
|
+
readonly [TypeId]: {
|
|
24
|
+
readonly _R: (_: never) => R
|
|
25
|
+
readonly _E: (_: never) => E
|
|
26
|
+
readonly _A: (_: never) => A
|
|
27
|
+
} = {
|
|
28
|
+
_R: identity,
|
|
29
|
+
_E: identity,
|
|
30
|
+
_A: identity,
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
20
34
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
21
35
|
|
|
22
|
-
export type ResourcesOf<T> = [T] extends [
|
|
23
|
-
|
|
24
|
-
export type
|
|
36
|
+
export type ResourcesOf<T> = [T] extends [Variance<infer R, infer _E, infer _A>] ? R : never
|
|
37
|
+
|
|
38
|
+
export type ErrorsOf<T> = [T] extends [Variance<infer _R, infer E, infer _A>] ? E : never
|
|
39
|
+
|
|
40
|
+
export type OutputOf<T> = [T] extends [Variance<infer _R, infer _E, infer A>] ? A : never
|
|
25
41
|
|
|
26
42
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
27
|
-
}
|
|
28
43
|
|
|
29
|
-
export interface
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
44
|
+
export interface Sink<out R, in E, in A> {
|
|
45
|
+
readonly event: (value: A) => Effect<R, never, unknown>
|
|
46
|
+
readonly error: (error: Cause<E>) => Effect<R, never, unknown>
|
|
47
|
+
readonly end: Effect<R, never, unknown>
|
|
48
|
+
}
|
|
34
49
|
|
|
35
|
-
export function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
):
|
|
40
|
-
|
|
41
|
-
emit,
|
|
42
|
-
failCause,
|
|
43
|
-
end,
|
|
50
|
+
export function Sink<A, R, E, R2, R3>(
|
|
51
|
+
event: (value: A) => Effect<R, never, unknown>,
|
|
52
|
+
error: (error: Cause<E>) => Effect<R2, never, unknown>,
|
|
53
|
+
end: Effect<R3, never, unknown>,
|
|
54
|
+
): Sink<R | R2 | R3, E, A> {
|
|
55
|
+
return { event, error, end }
|
|
44
56
|
}
|
|
45
57
|
}
|
|
46
58
|
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
export const TypeId = Fx.TypeId
|
|
60
|
+
export type TypeId = Fx.TypeId
|
|
61
|
+
|
|
62
|
+
export type ResourcesOf<T> = Fx.ResourcesOf<T>
|
|
63
|
+
export type ErrorOf<T> = Fx.ErrorsOf<T>
|
|
64
|
+
export type OutputOf<T> = Fx.OutputOf<T>
|
|
65
|
+
|
|
66
|
+
export type Sink<R, E, A> = Fx.Sink<R, E, A>
|
|
67
|
+
export const Sink = Fx.Sink
|
|
68
|
+
|
|
69
|
+
export function isFx<R, E, A>(v: unknown): v is Fx<R, E, A> {
|
|
70
|
+
return typeof v === 'object' && v != null && TypeId in v
|
|
51
71
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { deepStrictEqual } from 'assert'
|
|
2
|
+
|
|
3
|
+
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import * as Fiber from '@effect/io/Fiber'
|
|
5
|
+
import { millis } from '@fp-ts/data/Duration'
|
|
6
|
+
import { describe, it } from 'vitest'
|
|
7
|
+
|
|
8
|
+
import { collectAll } from '../run/collectAll.js'
|
|
9
|
+
|
|
10
|
+
import { HoldSubject } from './HoldSubject.js'
|
|
11
|
+
|
|
12
|
+
describe(import.meta.url, () => {
|
|
13
|
+
describe('HoldSubject', () => {
|
|
14
|
+
it('allows replaying latest events to late subscribers', async () => {
|
|
15
|
+
const test = Effect.gen(function* ($) {
|
|
16
|
+
const holdSubject = HoldSubject.unsafeMake<never, number>()
|
|
17
|
+
|
|
18
|
+
const producer = Effect.gen(function* ($) {
|
|
19
|
+
yield* $(Effect.sleep(millis(0)))
|
|
20
|
+
yield* $(holdSubject.event(1))
|
|
21
|
+
yield* $(Effect.sleep(millis(100)))
|
|
22
|
+
yield* $(holdSubject.event(2))
|
|
23
|
+
yield* $(Effect.sleep(millis(100)))
|
|
24
|
+
yield* $(holdSubject.event(3))
|
|
25
|
+
yield* $(Effect.sleep(millis(100)))
|
|
26
|
+
yield* $(holdSubject.event(4))
|
|
27
|
+
yield* $(Effect.sleep(millis(100)))
|
|
28
|
+
yield* $(holdSubject.event(5))
|
|
29
|
+
yield* $(Effect.sleep(millis(100)))
|
|
30
|
+
yield* $(holdSubject.event(6))
|
|
31
|
+
yield* $(holdSubject.end)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
yield* $(Effect.fork(producer))
|
|
35
|
+
|
|
36
|
+
const fiber1 = yield* $(Effect.fork(collectAll(holdSubject)))
|
|
37
|
+
|
|
38
|
+
yield* $(Effect.sleep(millis(75)))
|
|
39
|
+
|
|
40
|
+
const fiber2 = yield* $(Effect.fork(collectAll(holdSubject)))
|
|
41
|
+
|
|
42
|
+
yield* $(Effect.sleep(millis(75)))
|
|
43
|
+
|
|
44
|
+
const fiber3 = yield* $(Effect.fork(collectAll(holdSubject)))
|
|
45
|
+
|
|
46
|
+
const events1 = yield* $(Fiber.join(fiber1))
|
|
47
|
+
const events2 = yield* $(Fiber.join(fiber2))
|
|
48
|
+
const events3 = yield* $(Fiber.join(fiber3))
|
|
49
|
+
|
|
50
|
+
deepStrictEqual(events1, [1, 2, 3, 4, 5, 6], '1')
|
|
51
|
+
deepStrictEqual(events2, [1, 2, 3, 4, 5, 6], '2')
|
|
52
|
+
deepStrictEqual(events3, [2, 3, 4, 5, 6], '3')
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
await Effect.unsafeRunPromise(test)
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
})
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as Effect from '@effect/io/Effect'
|
|
2
|
+
import { identity } from '@fp-ts/data/Function'
|
|
3
|
+
import { MutableRef, make } from '@fp-ts/data/MutableRef'
|
|
4
|
+
import { Option, none } from '@fp-ts/data/Option'
|
|
5
|
+
|
|
6
|
+
import { Fx, Sink } from '../Fx.js'
|
|
7
|
+
import { never } from '../constructor/never.js'
|
|
8
|
+
import { HoldFx } from '../operator/hold.js'
|
|
9
|
+
|
|
10
|
+
import { isSubject, Subject } from './Subject.js'
|
|
11
|
+
|
|
12
|
+
export interface HoldSubject<E, A>
|
|
13
|
+
extends Fx<never, E, A>,
|
|
14
|
+
Sink<never, E, A>,
|
|
15
|
+
Subject.Variance<E, A>,
|
|
16
|
+
HoldSubject.Variance<E, A> {
|
|
17
|
+
readonly value: Effect.Effect<never, never, Option<A>>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export namespace HoldSubject {
|
|
21
|
+
export const TypeId = Symbol.for('@typed/fx/HoldSubject')
|
|
22
|
+
export type TypeId = typeof TypeId
|
|
23
|
+
|
|
24
|
+
export abstract class Variance<E, A> extends Subject.Variance<E, A> {
|
|
25
|
+
readonly [TypeId]: {
|
|
26
|
+
readonly _E: (_: never) => E
|
|
27
|
+
readonly _A: (_: never) => A
|
|
28
|
+
} = {
|
|
29
|
+
_E: identity,
|
|
30
|
+
_A: identity,
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
|
+
export type ErrorsOf<T> = [T] extends [Variance<infer E, infer _A>] ? E : never
|
|
36
|
+
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
|
+
export type OutputsOf<T> = [T] extends [Variance<infer _E, infer A>] ? A : never
|
|
39
|
+
|
|
40
|
+
export function unsafeMake<E, A>(value: MutableRef<Option<A>> = make(none)): HoldSubject<E, A> {
|
|
41
|
+
return new HoldSubjectImpl(value)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
class HoldSubjectImpl<E, A> extends HoldFx<never, E, A> implements HoldSubject<E, A> {
|
|
45
|
+
readonly [Subject.TypeId]: Subject.Variance<E, A>[Subject.TypeId] = {
|
|
46
|
+
_E: identity,
|
|
47
|
+
_A: identity,
|
|
48
|
+
};
|
|
49
|
+
readonly [TypeId]: HoldSubject.Variance<E, A>[TypeId] = this[Subject.TypeId]
|
|
50
|
+
|
|
51
|
+
constructor(value: MutableRef<Option<A>>) {
|
|
52
|
+
super(never, value)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
readonly value = Effect.sync(() => this.current.get())
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function isHoldSubject<E, A>(u: unknown): u is HoldSubject<E, A> {
|
|
60
|
+
return isSubject(u) && HoldSubject.TypeId in u
|
|
61
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as Effect from '@effect/io/Effect'
|
|
2
|
+
import * as Ref from '@effect/io/Ref'
|
|
3
|
+
import { equals } from '@fp-ts/data/Equal'
|
|
4
|
+
import { identity, pipe } from '@fp-ts/data/Function'
|
|
5
|
+
import * as MutableRef from '@fp-ts/data/MutableRef'
|
|
6
|
+
import * as Option from '@fp-ts/data/Option'
|
|
7
|
+
|
|
8
|
+
import { Fx } from '../Fx.js'
|
|
9
|
+
|
|
10
|
+
import { HoldSubject, isHoldSubject } from './HoldSubject.js'
|
|
11
|
+
import { Subject } from './Subject.js'
|
|
12
|
+
|
|
13
|
+
export interface RefSubject<A> extends HoldSubject<never, A>, Ref.Ref<A> {
|
|
14
|
+
readonly get: Effect.Effect<never, never, A>
|
|
15
|
+
readonly set: (a: A) => Effect.Effect<never, never, A>
|
|
16
|
+
readonly update: (f: (a: A) => A) => Effect.Effect<never, never, A>
|
|
17
|
+
readonly delete: Effect.Effect<never, never, Option.Option<A>>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function makeRef<A>(
|
|
21
|
+
initial: () => A,
|
|
22
|
+
eq: (a: A, b: A) => boolean = equals,
|
|
23
|
+
): Effect.Effect<never, never, RefSubject<A>> {
|
|
24
|
+
return Effect.sync(() => RefSubject.unsafeMake(initial, eq))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export namespace RefSubject {
|
|
28
|
+
export function unsafeMake<A>(
|
|
29
|
+
initial: () => A,
|
|
30
|
+
eq: (a: A, b: A) => boolean = equals,
|
|
31
|
+
): RefSubject<A> {
|
|
32
|
+
const mutableRef = MutableRef.make(Option.some(initial()))
|
|
33
|
+
const subject = HoldSubject.unsafeMake<never, A>(mutableRef)
|
|
34
|
+
|
|
35
|
+
const getValue = () =>
|
|
36
|
+
pipe(
|
|
37
|
+
mutableRef.get(),
|
|
38
|
+
Option.getOrElse(() => {
|
|
39
|
+
const a = initial()
|
|
40
|
+
|
|
41
|
+
mutableRef.set(Option.some(a))
|
|
42
|
+
|
|
43
|
+
return a
|
|
44
|
+
}),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
const modify = <B>(f: (a: A) => [B, A]): Effect.Effect<never, never, B> =>
|
|
48
|
+
Effect.suspendSucceed(() => {
|
|
49
|
+
const current = getValue()
|
|
50
|
+
const [b, a] = f(current)
|
|
51
|
+
|
|
52
|
+
if (eq(current, a)) {
|
|
53
|
+
return Effect.succeed(b)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
mutableRef.set(Option.some(a))
|
|
57
|
+
|
|
58
|
+
return pipe(subject.event(a), Effect.as(b))
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
const refSubject: RefSubject<A> = {
|
|
62
|
+
[Fx.TypeId]: subject[Fx.TypeId],
|
|
63
|
+
[Subject.TypeId]: subject[Subject.TypeId],
|
|
64
|
+
[HoldSubject.TypeId]: subject[HoldSubject.TypeId],
|
|
65
|
+
[Ref.RefTypeId]: {
|
|
66
|
+
_A: identity,
|
|
67
|
+
},
|
|
68
|
+
run: subject.run.bind(subject),
|
|
69
|
+
event: subject.event.bind(subject),
|
|
70
|
+
error: subject.error.bind(subject),
|
|
71
|
+
end: subject.end,
|
|
72
|
+
value: subject.value,
|
|
73
|
+
modify,
|
|
74
|
+
get get() {
|
|
75
|
+
return Ref.get(refSubject)
|
|
76
|
+
},
|
|
77
|
+
set(a: A) {
|
|
78
|
+
return Ref.updateAndGet(() => a)(refSubject)
|
|
79
|
+
},
|
|
80
|
+
update(f: (a: A) => A) {
|
|
81
|
+
return Ref.updateAndGet(f)(refSubject)
|
|
82
|
+
},
|
|
83
|
+
delete: Effect.sync(() => {
|
|
84
|
+
const option = mutableRef.get()
|
|
85
|
+
|
|
86
|
+
// Next pull should recompute the initial value
|
|
87
|
+
mutableRef.set(Option.none)
|
|
88
|
+
|
|
89
|
+
return option
|
|
90
|
+
}),
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return refSubject
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function isRefSubject<A>(u: unknown): u is RefSubject<A> {
|
|
98
|
+
return isHoldSubject(u) && Ref.RefTypeId in u
|
|
99
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { deepStrictEqual } from 'assert'
|
|
2
|
+
|
|
3
|
+
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import * as Fiber from '@effect/io/Fiber'
|
|
5
|
+
import { describe, it } from 'vitest'
|
|
6
|
+
|
|
7
|
+
import { collectAll } from '../run/collectAll.js'
|
|
8
|
+
|
|
9
|
+
import { Subject } from './Subject.js'
|
|
10
|
+
|
|
11
|
+
describe(import.meta.url, () => {
|
|
12
|
+
describe('Subject', () => {
|
|
13
|
+
it('allows broadcastig values directly to observers', async () => {
|
|
14
|
+
const test = Effect.gen(function* ($) {
|
|
15
|
+
const subject = Subject.unsafeMake<never, number>()
|
|
16
|
+
|
|
17
|
+
const fiber1 = yield* $(Effect.fork(collectAll(subject)))
|
|
18
|
+
const fiber2 = yield* $(Effect.fork(collectAll(subject)))
|
|
19
|
+
|
|
20
|
+
yield* $(Effect.yieldNow())
|
|
21
|
+
|
|
22
|
+
yield* $(subject.event(1))
|
|
23
|
+
yield* $(subject.event(2))
|
|
24
|
+
yield* $(subject.event(3))
|
|
25
|
+
yield* $(subject.end)
|
|
26
|
+
|
|
27
|
+
const events1 = yield* $(Fiber.join(fiber1))
|
|
28
|
+
const events2 = yield* $(Fiber.join(fiber2))
|
|
29
|
+
|
|
30
|
+
deepStrictEqual(events1, [1, 2, 3])
|
|
31
|
+
deepStrictEqual(events1, events2)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
await Effect.unsafeRunPromise(test)
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { identity } from '@fp-ts/data/Function'
|
|
2
|
+
|
|
3
|
+
import { Fx, isFx, Sink } from '../Fx.js'
|
|
4
|
+
import { never } from '../constructor/never.js'
|
|
5
|
+
import { MulticastFx } from '../operator/multicast.js'
|
|
6
|
+
|
|
7
|
+
export interface Subject<E, A> extends Fx<never, E, A>, Sink<never, E, A>, Subject.Variance<E, A> {}
|
|
8
|
+
|
|
9
|
+
export namespace Subject {
|
|
10
|
+
export const TypeId = Symbol.for('@typed/fx/Subject')
|
|
11
|
+
export type TypeId = typeof TypeId
|
|
12
|
+
|
|
13
|
+
export abstract class Variance<E, A> extends Fx.Variance<never, E, A> {
|
|
14
|
+
readonly [TypeId]: {
|
|
15
|
+
readonly _E: (_: never) => E
|
|
16
|
+
readonly _A: (_: never) => A
|
|
17
|
+
} = {
|
|
18
|
+
_E: identity,
|
|
19
|
+
_A: identity,
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
|
+
export type ErrorsOf<T> = [T] extends [Variance<infer E, infer _A>] ? E : never
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
|
+
export type OutputsOf<T> = [T] extends [Variance<infer _E, infer A>] ? A : never
|
|
28
|
+
|
|
29
|
+
export function unsafeMake<E, A>(): Subject<E, A> {
|
|
30
|
+
return new SubjectImpl()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
class SubjectImpl<E, A> extends MulticastFx<never, E, A> implements Subject<E, A> {
|
|
34
|
+
readonly [TypeId]: Subject.Variance<E, A>[TypeId] = {
|
|
35
|
+
_E: identity,
|
|
36
|
+
_A: identity,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
constructor() {
|
|
40
|
+
super(never)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function isSubject<E, A>(u: unknown): u is Subject<E, A> {
|
|
46
|
+
return isFx(u) && Subject.TypeId in u
|
|
47
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as Effect from '@effect/io/Effect'
|
|
2
|
+
import * as Ref from '@effect/io/Ref'
|
|
3
|
+
import * as Synchronized from '@effect/io/Ref/Synchronized'
|
|
4
|
+
import * as TSemaphore from '@effect/stm/TSemaphore'
|
|
5
|
+
import { equals } from '@fp-ts/data/Equal'
|
|
6
|
+
import { identity, pipe } from '@fp-ts/data/Function'
|
|
7
|
+
import * as MutableRef from '@fp-ts/data/MutableRef'
|
|
8
|
+
import * as Option from '@fp-ts/data/Option'
|
|
9
|
+
|
|
10
|
+
import { Fx } from '../Fx.js'
|
|
11
|
+
|
|
12
|
+
import { HoldSubject } from './HoldSubject.js'
|
|
13
|
+
import { isRefSubject, RefSubject } from './RefSubject.js'
|
|
14
|
+
import { Subject } from './Subject.js'
|
|
15
|
+
|
|
16
|
+
export interface SynchronizedSubject<A> extends RefSubject<A>, Synchronized.Synchronized<A> {
|
|
17
|
+
readonly updateEffect: <R2, E2>(f: (a: A) => Effect.Effect<R2, E2, A>) => Effect.Effect<R2, E2, A>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function makeSynchronized<A>(
|
|
21
|
+
initial: () => A,
|
|
22
|
+
eq: (a: A, b: A) => boolean = equals,
|
|
23
|
+
): Effect.Effect<never, never, SynchronizedSubject<A>> {
|
|
24
|
+
return Effect.sync(() => SynchronizedSubject.unsafeMake(initial, eq))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export namespace SynchronizedSubject {
|
|
28
|
+
export function unsafeMake<A>(
|
|
29
|
+
initial: () => A,
|
|
30
|
+
eq: (a: A, b: A) => boolean = equals,
|
|
31
|
+
): SynchronizedSubject<A> {
|
|
32
|
+
const mutableRef = MutableRef.make(Option.some(initial()))
|
|
33
|
+
const subject = HoldSubject.unsafeMake<never, A>(mutableRef)
|
|
34
|
+
const semaphore = TSemaphore.unsafeMake(1)
|
|
35
|
+
const locked = TSemaphore.withPermit(semaphore)
|
|
36
|
+
|
|
37
|
+
const getValue = () =>
|
|
38
|
+
pipe(
|
|
39
|
+
mutableRef.get(),
|
|
40
|
+
Option.getOrElse(() => {
|
|
41
|
+
const a = initial()
|
|
42
|
+
|
|
43
|
+
mutableRef.set(Option.some(a))
|
|
44
|
+
|
|
45
|
+
return a
|
|
46
|
+
}),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
const modifyEffect = <B, R2, E2>(
|
|
50
|
+
f: (a: A) => Effect.Effect<R2, E2, readonly [B, A]>,
|
|
51
|
+
): Effect.Effect<R2, E2, B> =>
|
|
52
|
+
locked(
|
|
53
|
+
Effect.gen(function* ($) {
|
|
54
|
+
const current = getValue()
|
|
55
|
+
const [b, a] = yield* $(f(current))
|
|
56
|
+
|
|
57
|
+
if (eq(current, a)) {
|
|
58
|
+
return b
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
mutableRef.set(Option.some(a))
|
|
62
|
+
|
|
63
|
+
yield* $(subject.event(a))
|
|
64
|
+
|
|
65
|
+
return b
|
|
66
|
+
}),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
const modify = <B>(f: (a: A) => readonly [B, A]): Effect.Effect<never, never, B> =>
|
|
70
|
+
modifyEffect((a) => Effect.sync(() => f(a)))
|
|
71
|
+
|
|
72
|
+
const synchronizedSubject: SynchronizedSubject<A> = {
|
|
73
|
+
[Fx.TypeId]: subject[Fx.TypeId],
|
|
74
|
+
[Subject.TypeId]: subject[Subject.TypeId],
|
|
75
|
+
[HoldSubject.TypeId]: subject[HoldSubject.TypeId],
|
|
76
|
+
[Ref.RefTypeId]: {
|
|
77
|
+
_A: identity,
|
|
78
|
+
},
|
|
79
|
+
[Synchronized.SynchronizedTypeId]: {
|
|
80
|
+
_A: identity,
|
|
81
|
+
},
|
|
82
|
+
run: subject.run.bind(subject),
|
|
83
|
+
event: subject.event.bind(subject),
|
|
84
|
+
error: subject.error.bind(subject),
|
|
85
|
+
end: subject.end,
|
|
86
|
+
value: subject.value,
|
|
87
|
+
modify,
|
|
88
|
+
modifyEffect,
|
|
89
|
+
get get() {
|
|
90
|
+
return Synchronized.get(synchronizedSubject)
|
|
91
|
+
},
|
|
92
|
+
set(a: A) {
|
|
93
|
+
return Ref.updateAndGet(() => a)(synchronizedSubject)
|
|
94
|
+
},
|
|
95
|
+
update(f: (a: A) => A) {
|
|
96
|
+
return Ref.updateAndGet(f)(synchronizedSubject)
|
|
97
|
+
},
|
|
98
|
+
updateEffect<R2, E2>(f: (a: A) => Effect.Effect<R2, E2, A>) {
|
|
99
|
+
return Synchronized.updateAndGetEffect(f)(synchronizedSubject)
|
|
100
|
+
},
|
|
101
|
+
delete: Effect.sync(() => {
|
|
102
|
+
const option = mutableRef.get()
|
|
103
|
+
|
|
104
|
+
// Next pull should recompute the initial value
|
|
105
|
+
mutableRef.set(Option.none)
|
|
106
|
+
|
|
107
|
+
return option
|
|
108
|
+
}),
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return synchronizedSubject
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function isSynchronizedSubject<A>(u: unknown): u is SynchronizedSubject<A> {
|
|
116
|
+
return isRefSubject(u) && Synchronized.SynchronizedTypeId in u
|
|
117
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as Deferred from '@effect/io/Deferred'
|
|
2
|
+
import * as Effect from '@effect/io/Effect'
|
|
3
|
+
import * as Fiber from '@effect/io/Fiber'
|
|
4
|
+
import * as Ref from '@effect/io/Ref'
|
|
5
|
+
import * as Schedule from '@effect/io/Schedule'
|
|
6
|
+
import { Scope } from '@effect/io/Scope'
|
|
7
|
+
import { millis } from '@fp-ts/data/Duration'
|
|
8
|
+
import { pipe } from '@fp-ts/data/Function'
|
|
9
|
+
|
|
10
|
+
export const asap = pipe(
|
|
11
|
+
Schedule.once(),
|
|
12
|
+
Schedule.delayed(() => millis(0)),
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export class RefCounter {
|
|
16
|
+
protected count = Ref.unsafeMake(this.initial)
|
|
17
|
+
protected fiber: Fiber.RuntimeFiber<never, void> | undefined
|
|
18
|
+
|
|
19
|
+
constructor(readonly initial: number, readonly deferred: Deferred.Deferred<never, void>) {}
|
|
20
|
+
|
|
21
|
+
readonly get = Ref.get(this.count)
|
|
22
|
+
|
|
23
|
+
readonly increment = pipe(
|
|
24
|
+
this.count,
|
|
25
|
+
Ref.updateAndGet((x) => x + 1),
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
readonly decrement = pipe(
|
|
29
|
+
this.count,
|
|
30
|
+
Ref.updateAndGet((x) => Math.max(0, x - 1)),
|
|
31
|
+
Effect.tap(() => this.checkShouldClose),
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
readonly wait = Deferred.await(this.deferred)
|
|
35
|
+
|
|
36
|
+
private checkShouldClose = Effect.suspendSucceed(() => {
|
|
37
|
+
const interrupt = this.fiber ? Fiber.interrupt(this.fiber) : Effect.unit()
|
|
38
|
+
|
|
39
|
+
this.fiber = undefined
|
|
40
|
+
|
|
41
|
+
return pipe(
|
|
42
|
+
interrupt,
|
|
43
|
+
Effect.flatMap(() => Ref.get(this.count)),
|
|
44
|
+
Effect.flatMap((x) =>
|
|
45
|
+
Effect.sync(() => {
|
|
46
|
+
if (x === 0) Deferred.unsafeDone(Effect.unit())(this.deferred)
|
|
47
|
+
}),
|
|
48
|
+
),
|
|
49
|
+
Effect.scheduleForked(asap),
|
|
50
|
+
Effect.tap((fiber) =>
|
|
51
|
+
Effect.sync(() => {
|
|
52
|
+
this.fiber = fiber
|
|
53
|
+
}),
|
|
54
|
+
),
|
|
55
|
+
)
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function withRefCounter<R, E, A, R2, E2, B>(
|
|
60
|
+
initialCount: number,
|
|
61
|
+
f: (counter: RefCounter) => Effect.Effect<R, E, A>,
|
|
62
|
+
onEnd: Effect.Effect<R2, E2, B>,
|
|
63
|
+
): Effect.Effect<R | R2 | Scope, E | E2, B> {
|
|
64
|
+
return Effect.gen(function* ($) {
|
|
65
|
+
const deferred = yield* $(Deferred.make<never, void>())
|
|
66
|
+
const counter = new RefCounter(initialCount, deferred)
|
|
67
|
+
|
|
68
|
+
const fiber = yield* $(Effect.forkScoped(f(counter)))
|
|
69
|
+
|
|
70
|
+
yield* $(counter.wait)
|
|
71
|
+
|
|
72
|
+
yield* $(Fiber.interrupt(fiber))
|
|
73
|
+
|
|
74
|
+
return yield* $(onEnd)
|
|
75
|
+
})
|
|
76
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Effect from '@effect/io/Effect'
|
|
2
|
+
import { pipe } from '@fp-ts/data/Function'
|
|
3
|
+
|
|
4
|
+
export function withEarlyExit<R, E, A, R2, E2, B>(
|
|
5
|
+
f: (_: Effect.Effect<never, never, never>) => Effect.Effect<R, E, A>,
|
|
6
|
+
onEnd: Effect.Effect<R2, E2, B>,
|
|
7
|
+
): Effect.Effect<R | R2, E | E2, A | B> {
|
|
8
|
+
return Effect.asyncEffect((cb) =>
|
|
9
|
+
pipe(
|
|
10
|
+
Effect.sync(() => cb(onEnd)),
|
|
11
|
+
Effect.flatMap(Effect.never),
|
|
12
|
+
f,
|
|
13
|
+
Effect.onExit((exit) => Effect.sync(() => cb(Effect.done(exit)))),
|
|
14
|
+
),
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as Effect from '@effect/io/Effect'
|
|
2
|
+
import { pipe } from '@fp-ts/data/Function'
|
|
3
|
+
|
|
4
|
+
import { Fx } from '../Fx.js'
|
|
5
|
+
|
|
6
|
+
export const acquireUseRelease =
|
|
7
|
+
<R, E, A>(acquire: Effect.Effect<R, E, A>) =>
|
|
8
|
+
<R2>(release: (a: A) => Effect.Effect<R2, never, void>) =>
|
|
9
|
+
<R3, E3, B>(use: (a: A) => Fx<R3, E3, B>): Fx<R | R2 | R3, E | E3, B> =>
|
|
10
|
+
new AcquireUseReleaseFx(acquire, release, use)
|
|
11
|
+
|
|
12
|
+
class AcquireUseReleaseFx<R, E, A, R2, R3, E3, B>
|
|
13
|
+
extends Fx.Variance<R | R2 | R3, E | E3, B>
|
|
14
|
+
implements Fx<R | R2 | R3, E | E3, B>
|
|
15
|
+
{
|
|
16
|
+
constructor(
|
|
17
|
+
readonly acquire: Effect.Effect<R, E, A>,
|
|
18
|
+
readonly release: (a: A) => Effect.Effect<R2, never, void>,
|
|
19
|
+
readonly use: (a: A) => Fx<R3, E3, B>,
|
|
20
|
+
) {
|
|
21
|
+
super()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
run<R4>(sink: Fx.Sink<R4, E | E3, B>) {
|
|
25
|
+
return pipe(
|
|
26
|
+
Effect.acquireUseRelease(this.acquire, (a) => this.use(a).run(sink), this.release),
|
|
27
|
+
Effect.matchCauseEffect(sink.error, Effect.succeed),
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as Effect from '@effect/io/Effect'
|
|
2
|
+
import { FiberId } from '@effect/io/Fiber/Id'
|
|
3
|
+
import { flow } from '@fp-ts/data/Function'
|
|
4
|
+
|
|
5
|
+
import { Fx } from '../Fx.js'
|
|
6
|
+
|
|
7
|
+
import { fromEffect } from './fromEffect.js'
|
|
8
|
+
|
|
9
|
+
export const async: <R, E, A>(
|
|
10
|
+
register: (callback: (_: Effect.Effect<R, E, A>) => void) => void,
|
|
11
|
+
blockingOn?: FiberId | undefined,
|
|
12
|
+
) => Fx<R, E, A> = flow(Effect.async, fromEffect)
|