@typed/fx 1.0.9 → 1.0.11
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/src/Fx.ts.html +1 -1
- package/coverage/src/Subject/Subject.ts.html +1 -1
- package/coverage/src/_internal/RefCounter.ts.html +1 -1
- package/coverage/src/_internal/earlyExit.ts.html +1 -1
- package/coverage/src/constructor/at.ts.html +1 -1
- package/coverage/src/constructor/fromArray.ts.html +1 -1
- package/coverage/src/constructor/fromEffect.ts.html +1 -1
- package/coverage/src/constructor/fromEmitter.ts.html +1 -1
- package/coverage/src/constructor/serviceWith.ts.html +70 -66
- package/coverage/src/constructor/succeed.ts.html +11 -12
- package/coverage/src/operator/delay.ts.html +1 -1
- package/coverage/src/operator/filterEffect.ts.html +1 -1
- package/coverage/src/operator/filterMap.ts.html +78 -74
- package/coverage/src/operator/filterMapEffect.ts.html +1 -1
- package/coverage/src/operator/flatMap.ts.html +1 -1
- package/coverage/src/operator/flatMapConcurrently.ts.html +71 -66
- package/coverage/src/operator/merge.ts.html +1 -1
- package/coverage/src/operator/multicast.ts.html +1 -1
- package/coverage/src/operator/provideService.ts.html +1 -1
- package/coverage/src/operator/provideServiceEffect.ts.html +1 -1
- package/coverage/src/operator/scan.ts.html +70 -66
- package/coverage/src/operator/scanEffect.ts.html +1 -1
- package/coverage/src/operator/skipRepeats.ts.html +1 -1
- package/coverage/src/operator/slice.ts.html +78 -74
- package/coverage/src/operator/startWith.ts.html +70 -66
- package/coverage/src/operator/switchMap.ts.html +1 -1
- package/coverage/src/operator/withPermit.ts.html +1 -1
- package/coverage/src/run/collectAll.ts.html +1 -1
- package/coverage/src/run/observe.ts.html +1 -1
- package/coverage/src/run/reduce.ts.html +70 -66
- package/coverage/src/run/run.ts.html +1 -1
- package/dist/Fx.js +1 -1
- package/dist/Subject/HoldSubject.d.ts +1 -1
- package/dist/Subject/HoldSubject.d.ts.map +1 -1
- package/dist/Subject/HoldSubject.js +3 -3
- package/dist/Subject/HoldSubject.js.map +1 -1
- package/dist/Subject/RefSubject.d.ts +1 -1
- package/dist/Subject/RefSubject.d.ts.map +1 -1
- package/dist/Subject/RefSubject.js +3 -3
- package/dist/Subject/RefSubject.js.map +1 -1
- package/dist/Subject/Subject.js +1 -1
- package/dist/Subject/SynchronizedSubject.d.ts.map +1 -1
- package/dist/Subject/SynchronizedSubject.js +5 -6
- package/dist/Subject/SynchronizedSubject.js.map +1 -1
- package/dist/_internal/RefCounter.js +2 -2
- package/dist/_internal/RefCounter.js.map +1 -1
- package/dist/_internal/earlyExit.js +1 -1
- package/dist/constructor/acquireUseRelease.js +1 -1
- package/dist/constructor/async.js +1 -1
- package/dist/constructor/asyncEffect.js +1 -1
- package/dist/constructor/asyncOption.d.ts +1 -1
- package/dist/constructor/asyncOption.js +1 -1
- package/dist/constructor/at.d.ts.map +1 -1
- package/dist/constructor/at.js +1 -1
- package/dist/constructor/at.js.map +1 -1
- package/dist/constructor/die.js +1 -1
- package/dist/constructor/dieMessage.js +1 -1
- package/dist/constructor/dieSync.js +1 -1
- package/dist/constructor/done.js +1 -1
- package/dist/constructor/fail.js +1 -1
- package/dist/constructor/failCause.js +1 -1
- package/dist/constructor/failCauseSync.js +1 -1
- package/dist/constructor/fromArray.js +1 -1
- package/dist/constructor/fromEffect.js +1 -1
- package/dist/constructor/fromEither.d.ts +1 -1
- package/dist/constructor/fromEither.js +1 -1
- package/dist/constructor/fromEitherCause.d.ts +1 -1
- package/dist/constructor/fromEitherCause.js +1 -1
- package/dist/constructor/fromEmitter.d.ts +4 -4
- package/dist/constructor/fromEmitter.d.ts.map +1 -1
- package/dist/constructor/fromEmitter.js +4 -4
- package/dist/constructor/fromEmitter.js.map +1 -1
- package/dist/constructor/fromFiber.js +1 -1
- package/dist/constructor/fromFiberEffect.js +1 -1
- package/dist/constructor/fromFxEffect.js +1 -1
- package/dist/constructor/fromOption.d.ts +1 -1
- package/dist/constructor/fromOption.js +1 -1
- package/dist/constructor/periodic.d.ts.map +1 -1
- package/dist/constructor/periodic.js +1 -1
- package/dist/constructor/periodic.js.map +1 -1
- package/dist/constructor/promise.js +1 -1
- package/dist/constructor/promiseAbort.js +1 -1
- package/dist/constructor/promiseFx.js +1 -1
- package/dist/constructor/random.js +1 -1
- package/dist/constructor/scheduled.js +1 -1
- package/dist/constructor/service.d.ts.map +1 -1
- package/dist/constructor/service.js +1 -1
- package/dist/constructor/service.js.map +1 -1
- package/dist/constructor/serviceWith.d.ts.map +1 -1
- package/dist/constructor/serviceWith.js +1 -2
- package/dist/constructor/serviceWith.js.map +1 -1
- package/dist/constructor/serviceWithEffect.d.ts.map +1 -1
- package/dist/constructor/serviceWithEffect.js +1 -2
- package/dist/constructor/serviceWithEffect.js.map +1 -1
- package/dist/constructor/serviceWithFx.js +1 -1
- package/dist/constructor/serviceWithFx.js.map +1 -1
- package/dist/constructor/succeed.js +1 -1
- package/dist/constructor/sync.js +1 -1
- package/dist/constructor/tryCatchPromise.js +1 -1
- package/dist/constructor/tryCatchPromiseAbort.js +1 -1
- package/dist/constructor/tryPromise.js +1 -1
- package/dist/constructor/tryPromiseAbort.js +1 -1
- package/dist/operator/catch.js +1 -1
- package/dist/operator/catchAll.js +2 -2
- package/dist/operator/catchAllDefect.js +2 -2
- package/dist/operator/combine.js +1 -1
- package/dist/operator/compact.d.ts +1 -1
- package/dist/operator/compact.js +1 -1
- package/dist/operator/contramapContext.d.ts +5 -0
- package/dist/operator/contramapContext.d.ts.map +1 -0
- package/dist/operator/contramapContext.js +25 -0
- package/dist/operator/contramapContext.js.map +1 -0
- package/dist/operator/debounce.d.ts.map +1 -1
- package/dist/operator/debounce.js +1 -1
- package/dist/operator/debounce.js.map +1 -1
- package/dist/operator/delay.d.ts.map +1 -1
- package/dist/operator/delay.js +1 -1
- package/dist/operator/delay.js.map +1 -1
- package/dist/operator/during.js +1 -1
- package/dist/operator/exhaustMap.js +1 -1
- package/dist/operator/exhaustMapEffect.js +1 -1
- package/dist/operator/exhaustMapLatest.js +1 -1
- package/dist/operator/exhaustMapLatestEffect.js +1 -1
- package/dist/operator/filter.d.ts +1 -1
- package/dist/operator/filterEffect.js +1 -1
- package/dist/operator/filterMap.d.ts +1 -1
- package/dist/operator/filterMap.js +2 -2
- package/dist/operator/filterMapEffect.d.ts +1 -1
- package/dist/operator/filterMapEffect.js +2 -2
- package/dist/operator/flatMap.js +1 -1
- package/dist/operator/flatMapCause.js +1 -1
- package/dist/operator/flatMapConcurrently.js +3 -3
- package/dist/operator/flatMapConcurrently.js.map +1 -1
- package/dist/operator/flatMapEffect.js +1 -1
- package/dist/operator/flatMapEffectConcurrently.js +1 -1
- package/dist/operator/hold.d.ts +1 -1
- package/dist/operator/hold.d.ts.map +1 -1
- package/dist/operator/hold.js +3 -3
- package/dist/operator/hold.js.map +1 -1
- package/dist/operator/index.d.ts +2 -2
- package/dist/operator/index.d.ts.map +1 -1
- package/dist/operator/index.js +2 -2
- package/dist/operator/index.js.map +1 -1
- package/dist/operator/interruptible.js +1 -1
- package/dist/operator/mapCause.js +1 -1
- package/dist/operator/merge.js +1 -1
- package/dist/operator/mergeRace.js +1 -1
- package/dist/operator/multicast.d.ts.map +1 -1
- package/dist/operator/multicast.js +7 -7
- package/dist/operator/multicast.js.map +1 -1
- package/dist/operator/onDone.js +2 -2
- package/dist/operator/onDoneCause.js +1 -1
- package/dist/operator/onExit.js +1 -1
- package/dist/operator/onInterrupt.js +1 -1
- package/dist/operator/provideContext.d.ts +4 -0
- package/dist/operator/provideContext.d.ts.map +1 -0
- package/dist/operator/provideContext.js +18 -0
- package/dist/operator/provideContext.js.map +1 -0
- package/dist/operator/provideLayer.js +1 -1
- package/dist/operator/provideService.d.ts.map +1 -1
- package/dist/operator/provideService.js +2 -2
- package/dist/operator/provideService.js.map +1 -1
- package/dist/operator/provideServiceEffect.d.ts.map +1 -1
- package/dist/operator/provideServiceEffect.js +2 -2
- package/dist/operator/provideServiceEffect.js.map +1 -1
- package/dist/operator/provideSomeLayer.js +1 -1
- package/dist/operator/race.js +4 -5
- package/dist/operator/race.js.map +1 -1
- package/dist/operator/sample.js +1 -1
- package/dist/operator/sampleEffect.js +1 -1
- package/dist/operator/sandbox.js +1 -1
- package/dist/operator/scan.js +1 -1
- package/dist/operator/scanEffect.js +3 -4
- package/dist/operator/scanEffect.js.map +1 -1
- package/dist/operator/separate.d.ts +1 -1
- package/dist/operator/separate.js +2 -2
- package/dist/operator/since.js +1 -1
- package/dist/operator/skipAfter.d.ts +1 -1
- package/dist/operator/skipRepeats.js +3 -3
- package/dist/operator/skipRepeats.js.map +1 -1
- package/dist/operator/skipUntil.d.ts +1 -1
- package/dist/operator/skipWhile.d.ts +1 -1
- package/dist/operator/skipWhile.js +2 -2
- package/dist/operator/slice.js +1 -1
- package/dist/operator/snapshot.js +3 -3
- package/dist/operator/snapshot.js.map +1 -1
- package/dist/operator/snapshotEffect.js +4 -6
- package/dist/operator/snapshotEffect.js.map +1 -1
- package/dist/operator/startWith.js +1 -1
- package/dist/operator/startWithEffect.js +1 -1
- package/dist/operator/struct.js +1 -1
- package/dist/operator/switchMap.js +1 -1
- package/dist/operator/switchMapCause.js +1 -1
- package/dist/operator/switchMapEffect.js +1 -1
- package/dist/operator/switchMapError.js +2 -2
- package/dist/operator/switchMatch.js +3 -3
- package/dist/operator/switchMatch.js.map +1 -1
- package/dist/operator/takeUntil.d.ts +1 -1
- package/dist/operator/takeWhile.d.ts +1 -1
- package/dist/operator/takeWhile.js +2 -2
- package/dist/operator/tap.js +1 -1
- package/dist/operator/tapCause.js +1 -1
- package/dist/operator/tapDefect.js +2 -2
- package/dist/operator/tapError.js +2 -2
- package/dist/operator/throttle.d.ts.map +1 -1
- package/dist/operator/throttle.js +1 -1
- package/dist/operator/throttle.js.map +1 -1
- package/dist/operator/uninterruptible.js +1 -1
- package/dist/operator/withItems.js +1 -1
- package/dist/operator/withPermit.d.ts +2 -2
- package/dist/operator/withPermit.d.ts.map +1 -1
- package/dist/operator/withPermit.js +2 -3
- package/dist/operator/withPermit.js.map +1 -1
- package/dist/operator/withRuntimeFlags.js +1 -1
- package/dist/operator/zip.js +1 -1
- package/dist/run/collectAll.js +1 -1
- package/dist/run/collectN.js +1 -1
- package/dist/run/drain.d.ts.map +1 -1
- package/dist/run/drain.js +1 -1
- package/dist/run/drain.js.map +1 -1
- package/dist/run/observe.js +1 -1
- package/dist/run/reduce.js +1 -1
- package/dist/run/run.js +3 -3
- package/dist/run/run.js.map +1 -1
- package/dist/run/unsafe.d.ts +5 -5
- package/dist/run/unsafe.d.ts.map +1 -1
- package/dist/run/unsafe.js +5 -5
- package/dist/run/unsafe.js.map +1 -1
- package/dist/typeclass/Applicative.js +1 -1
- package/dist/typeclass/Applicative.js.map +1 -1
- package/dist/typeclass/Bicovariant.d.ts.map +1 -1
- package/dist/typeclass/Bicovariant.js +1 -1
- package/dist/typeclass/Bicovariant.js.map +1 -1
- package/dist/typeclass/Product.d.ts.map +1 -1
- package/dist/typeclass/Product.js +1 -1
- package/dist/typeclass/Product.js.map +1 -1
- package/dist/typeclass/SemiCoproduct.js +4 -4
- package/dist/typeclass/SemiCoproduct.js.map +1 -1
- package/dist/typeclass/SemiProduct.d.ts.map +1 -1
- package/dist/typeclass/SemiProduct.js +2 -2
- package/dist/typeclass/SemiProduct.js.map +1 -1
- package/package.json +5 -6
- package/src/Fx.ts +1 -1
- package/src/Subject/HoldSubject.test.ts +1 -1
- package/src/Subject/HoldSubject.ts +3 -3
- package/src/Subject/RefSubject.ts +3 -3
- package/src/Subject/Subject.test.ts +1 -1
- package/src/Subject/Subject.ts +1 -1
- package/src/Subject/SynchronizedSubject.ts +5 -6
- package/src/_internal/RefCounter.ts +2 -2
- package/src/_internal/earlyExit.ts +1 -1
- package/src/constructor/acquireUseRelease.ts +1 -1
- package/src/constructor/async.ts +1 -1
- package/src/constructor/asyncEffect.ts +1 -1
- package/src/constructor/asyncOption.ts +2 -2
- package/src/constructor/at.ts +1 -1
- package/src/constructor/die.ts +1 -1
- package/src/constructor/dieMessage.ts +1 -1
- package/src/constructor/dieSync.ts +1 -1
- package/src/constructor/done.ts +1 -1
- package/src/constructor/fail.ts +1 -1
- package/src/constructor/failCause.ts +1 -1
- package/src/constructor/failCauseSync.ts +1 -1
- package/src/constructor/fromArray.test.ts +1 -1
- package/src/constructor/fromArray.ts +1 -1
- package/src/constructor/fromEffect.test.ts +1 -1
- package/src/constructor/fromEffect.ts +1 -1
- package/src/constructor/fromEither.ts +2 -2
- package/src/constructor/fromEitherCause.ts +2 -2
- package/src/constructor/fromEmitter.test.ts +1 -1
- package/src/constructor/fromEmitter.ts +7 -8
- package/src/constructor/fromFiber.ts +1 -1
- package/src/constructor/fromFiberEffect.ts +1 -1
- package/src/constructor/fromFxEffect.ts +1 -1
- package/src/constructor/fromIterable.test.ts +1 -1
- package/src/constructor/fromOption.ts +2 -2
- package/src/constructor/periodic.ts +1 -1
- package/src/constructor/promise.ts +1 -1
- package/src/constructor/promiseAbort.ts +1 -1
- package/src/constructor/promiseFx.ts +1 -1
- package/src/constructor/random.ts +1 -1
- package/src/constructor/scheduled.ts +1 -1
- package/src/constructor/service.ts +1 -1
- package/src/constructor/serviceWith.ts +3 -4
- package/src/constructor/serviceWithEffect.ts +2 -3
- package/src/constructor/serviceWithFx.ts +1 -1
- package/src/constructor/succeed.ts +1 -1
- package/src/constructor/sync.ts +1 -1
- package/src/constructor/tryCatchPromise.ts +1 -1
- package/src/constructor/tryCatchPromiseAbort.ts +1 -1
- package/src/constructor/tryPromise.ts +1 -1
- package/src/constructor/tryPromiseAbort.ts +1 -1
- package/src/operator/catchAll.ts +2 -2
- package/src/operator/catchAllCause.test.ts +2 -2
- package/src/operator/catchAllDefect.ts +2 -2
- package/src/operator/combine.test.ts +2 -2
- package/src/operator/combine.ts +1 -1
- package/src/operator/compact.ts +2 -2
- package/src/operator/concatMap.test.ts +2 -2
- package/src/operator/continueWith.test.ts +2 -2
- package/src/operator/contramapContext.ts +34 -0
- package/src/operator/debounce.test.ts +2 -2
- package/src/operator/debounce.ts +1 -1
- package/src/operator/delay.ts +1 -1
- package/src/operator/during.ts +1 -1
- package/src/operator/exhaustMap.test.ts +2 -2
- package/src/operator/exhaustMap.ts +1 -1
- package/src/operator/exhaustMapEffect.ts +1 -1
- package/src/operator/exhaustMapLatest.test.ts +2 -2
- package/src/operator/exhaustMapLatest.ts +1 -1
- package/src/operator/exhaustMapLatestEffect.ts +1 -1
- package/src/operator/filter.test.ts +2 -2
- package/src/operator/filter.ts +1 -1
- package/src/operator/filterEffect.test.ts +2 -2
- package/src/operator/filterEffect.ts +1 -1
- package/src/operator/filterMap.test.ts +4 -4
- package/src/operator/filterMap.ts +2 -2
- package/src/operator/filterMapEffect.test.ts +4 -4
- package/src/operator/filterMapEffect.ts +2 -2
- package/src/operator/flatMap.test.ts +3 -3
- package/src/operator/flatMap.ts +1 -1
- package/src/operator/flatMapCause.ts +1 -1
- package/src/operator/flatMapConcurrently.test.ts +2 -2
- package/src/operator/flatMapConcurrently.ts +3 -3
- package/src/operator/flatMapEffect.ts +1 -1
- package/src/operator/flatMapEffectConcurrently.ts +1 -1
- package/src/operator/hold.test.ts +1 -1
- package/src/operator/hold.ts +3 -3
- package/src/operator/index.ts +2 -2
- package/src/operator/interruptible.ts +1 -1
- package/src/operator/loop.test.ts +2 -2
- package/src/operator/map.test.ts +2 -2
- package/src/operator/mapCause.test.ts +3 -3
- package/src/operator/mapCause.ts +1 -1
- package/src/operator/merge.test.ts +2 -2
- package/src/operator/merge.ts +1 -1
- package/src/operator/mergeRace.test.ts +3 -3
- package/src/operator/mergeRace.ts +1 -1
- package/src/operator/multicast.test.ts +2 -2
- package/src/operator/multicast.ts +7 -11
- package/src/operator/onDone.ts +2 -2
- package/src/operator/onDoneCause.ts +1 -1
- package/src/operator/onExit.ts +1 -1
- package/src/operator/onInterrupt.ts +1 -1
- package/src/operator/{provideEnvironment.ts → provideContext.ts} +5 -5
- package/src/operator/provideLayer.ts +1 -1
- package/src/operator/provideService.test.ts +2 -2
- package/src/operator/provideService.ts +2 -2
- package/src/operator/provideServiceEffect.test.ts +2 -2
- package/src/operator/provideServiceEffect.ts +2 -2
- package/src/operator/provideSomeLayer.ts +1 -1
- package/src/operator/race.test.ts +2 -2
- package/src/operator/race.ts +17 -18
- package/src/operator/sample.ts +1 -1
- package/src/operator/sandbox.ts +1 -1
- package/src/operator/scan.test.ts +2 -2
- package/src/operator/scan.ts +1 -1
- package/src/operator/scanEffect.test.ts +3 -3
- package/src/operator/scanEffect.ts +9 -7
- package/src/operator/separate.test.ts +2 -2
- package/src/operator/separate.ts +2 -2
- package/src/operator/since.ts +1 -1
- package/src/operator/skipAfter.test.ts +2 -2
- package/src/operator/skipAfter.ts +1 -1
- package/src/operator/skipRepeats.test.ts +2 -2
- package/src/operator/skipRepeats.ts +3 -3
- package/src/operator/skipUntil.test.ts +2 -2
- package/src/operator/skipUntil.ts +1 -1
- package/src/operator/skipWhile.ts +2 -2
- package/src/operator/slice.test.ts +2 -2
- package/src/operator/slice.ts +1 -1
- package/src/operator/snapshot.test.ts +2 -2
- package/src/operator/snapshot.ts +3 -3
- package/src/operator/snapshotEffect.test.ts +2 -2
- package/src/operator/snapshotEffect.ts +14 -18
- package/src/operator/startWith.ts +1 -1
- package/src/operator/startWithEffect.ts +1 -1
- package/src/operator/struct.test.ts +2 -2
- package/src/operator/struct.ts +1 -1
- package/src/operator/switchMap.test.ts +2 -2
- package/src/operator/switchMap.ts +1 -1
- package/src/operator/switchMapCause.test.ts +3 -3
- package/src/operator/switchMapCause.ts +1 -1
- package/src/operator/switchMapEffect.ts +1 -1
- package/src/operator/switchMapError.ts +2 -2
- package/src/operator/switchMatch.test.ts +2 -2
- package/src/operator/switchMatch.ts +3 -3
- package/src/operator/takeUntil.test.ts +2 -2
- package/src/operator/takeUntil.ts +1 -1
- package/src/operator/takeWhile.ts +2 -2
- package/src/operator/tap.ts +1 -1
- package/src/operator/tapCause.ts +1 -1
- package/src/operator/tapDefect.ts +2 -2
- package/src/operator/tapError.ts +2 -2
- package/src/operator/throttle.test.ts +2 -2
- package/src/operator/throttle.ts +1 -1
- package/src/operator/uninterruptible.ts +1 -1
- package/src/operator/withItems.ts +1 -1
- package/src/operator/withPermit.ts +5 -6
- package/src/operator/withRuntimeFlags.ts +1 -1
- package/src/operator/zip.test.ts +2 -2
- package/src/operator/zip.ts +1 -1
- package/src/operator/zipItems.test.ts +2 -2
- package/src/run/collectAll.ts +1 -1
- package/src/run/collectN.ts +1 -1
- package/src/run/drain.ts +3 -1
- package/src/run/observe.ts +1 -1
- package/src/run/reduce.ts +1 -1
- package/src/run/run.ts +3 -3
- package/src/run/unsafe.ts +9 -10
- package/src/typeclass/Applicative.ts +2 -2
- package/src/typeclass/Bicovariant.ts +1 -1
- package/src/typeclass/Product.ts +2 -1
- package/src/typeclass/SemiCoproduct.ts +4 -4
- package/src/typeclass/SemiProduct.ts +5 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/operator/provideEnvironment.d.ts +0 -4
- package/dist/operator/provideEnvironment.d.ts.map +0 -1
- package/dist/operator/provideEnvironment.js +0 -18
- package/dist/operator/provideEnvironment.js.map +0 -1
- package/dist/operator/provideSomeEnvironment.d.ts +0 -4
- package/dist/operator/provideSomeEnvironment.d.ts.map +0 -1
- package/dist/operator/provideSomeEnvironment.js +0 -18
- package/dist/operator/provideSomeEnvironment.js.map +0 -1
- package/src/operator/during.test.ts +0 -49
- package/src/operator/provideSomeEnvironment.ts +0 -29
- package/src/operator/since.test.ts +0 -48
- package/src/operator/until.test.ts +0 -48
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
-
import { pipe } from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
5
|
import { describe, it } from 'vitest'
|
|
6
6
|
|
|
7
7
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -17,7 +17,7 @@ describe(import.meta.url, () => {
|
|
|
17
17
|
skipRepeats,
|
|
18
18
|
collectAll,
|
|
19
19
|
)
|
|
20
|
-
const events = await Effect.
|
|
20
|
+
const events = await Effect.runPromise(test)
|
|
21
21
|
|
|
22
22
|
deepStrictEqual(events, [1, 2, 3, 1, 2])
|
|
23
23
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Effect from '@effect/io/Effect'
|
|
2
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
3
|
+
import * as Option from '@fp-ts/core/Option'
|
|
2
4
|
import { equals } from '@fp-ts/data/Equal'
|
|
3
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
4
|
-
import * as Option from '@fp-ts/data/Option'
|
|
5
5
|
|
|
6
6
|
import { Fx } from '../Fx.js'
|
|
7
7
|
|
|
@@ -23,7 +23,7 @@ class SkipRepeatsWithFx<R, E, A> extends Fx.Variance<R, E, A> implements Fx<R, E
|
|
|
23
23
|
|
|
24
24
|
run<R2>(sink: Fx.Sink<R2, E, A>) {
|
|
25
25
|
return Effect.suspendSucceed(() => {
|
|
26
|
-
let previous: Option.Option<A> = Option.none
|
|
26
|
+
let previous: Option.Option<A> = Option.none()
|
|
27
27
|
|
|
28
28
|
return this.self.run({
|
|
29
29
|
...sink,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
-
import { pipe } from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
5
|
import { describe, it } from 'vitest'
|
|
6
6
|
|
|
7
7
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -17,7 +17,7 @@ describe(import.meta.url, () => {
|
|
|
17
17
|
skipUntil((x) => x === 4),
|
|
18
18
|
collectAll,
|
|
19
19
|
)
|
|
20
|
-
const events = await Effect.
|
|
20
|
+
const events = await Effect.runPromise(test)
|
|
21
21
|
|
|
22
22
|
deepStrictEqual(events, [4, 5, 6, 7, 8])
|
|
23
23
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
-
import { pipe } from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
5
|
import { describe, it } from 'vitest'
|
|
6
6
|
|
|
7
7
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -13,7 +13,7 @@ describe(import.meta.url, () => {
|
|
|
13
13
|
describe(slice.name, () => {
|
|
14
14
|
it('allows skipping and taking a specified amount of values', async () => {
|
|
15
15
|
const test = pipe(fromArray([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]), slice(3, 4), collectAll)
|
|
16
|
-
const events = await Effect.
|
|
16
|
+
const events = await Effect.runPromise(test)
|
|
17
17
|
|
|
18
18
|
deepStrictEqual(events, [4, 5, 6, 7])
|
|
19
19
|
})
|
package/src/operator/slice.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
5
|
import { millis } from '@fp-ts/data/Duration'
|
|
5
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -19,7 +19,7 @@ describe(import.meta.url, () => {
|
|
|
19
19
|
snapshot(mergeAll(at(millis(0), 1), at(millis(100), 5)), (a, b) => a + b),
|
|
20
20
|
collectAll,
|
|
21
21
|
)
|
|
22
|
-
const events = await Effect.
|
|
22
|
+
const events = await Effect.runPromise(test)
|
|
23
23
|
|
|
24
24
|
deepStrictEqual(events, [2, 10, 15])
|
|
25
25
|
})
|
package/src/operator/snapshot.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
3
|
import * as Ref from '@effect/io/Ref'
|
|
4
|
-
import { pipe } from '@fp-ts/
|
|
5
|
-
import * as Option from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
+
import * as Option from '@fp-ts/core/Option'
|
|
6
6
|
|
|
7
7
|
import { Fx } from '../Fx.js'
|
|
8
8
|
import { run } from '../run/run.js'
|
|
@@ -27,7 +27,7 @@ class SnapshotFx<R, E, A, R2, E2, B, C>
|
|
|
27
27
|
const { fx, sampled, f } = this
|
|
28
28
|
|
|
29
29
|
return Effect.gen(function* ($) {
|
|
30
|
-
const ref = yield* $(Ref.make<Option.Option<B>>(Option.none))
|
|
30
|
+
const ref = yield* $(Ref.make<Option.Option<B>>(Option.none()))
|
|
31
31
|
|
|
32
32
|
yield* $(
|
|
33
33
|
pipe(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
5
|
import { millis } from '@fp-ts/data/Duration'
|
|
5
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -21,7 +21,7 @@ describe(import.meta.url, () => {
|
|
|
21
21
|
),
|
|
22
22
|
collectAll,
|
|
23
23
|
)
|
|
24
|
-
const events = await Effect.
|
|
24
|
+
const events = await Effect.runPromise(test)
|
|
25
25
|
|
|
26
26
|
deepStrictEqual(events, [2, 10, 15])
|
|
27
27
|
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
3
|
import * as Ref from '@effect/io/Ref/Synchronized'
|
|
4
|
-
import { pipe } from '@fp-ts/
|
|
5
|
-
import * as Option from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
+
import * as Option from '@fp-ts/core/Option'
|
|
6
6
|
|
|
7
7
|
import { Fx } from '../Fx.js'
|
|
8
8
|
import { run } from '../run/run.js'
|
|
@@ -31,7 +31,7 @@ class SnapshotEffectFx<R, E, A, R2, E2, B, R3, E3, C>
|
|
|
31
31
|
const { fx, sampled, f } = this
|
|
32
32
|
|
|
33
33
|
return Effect.gen(function* ($) {
|
|
34
|
-
const ref = yield* $(Ref.make<Option.Option<B>>(Option.none))
|
|
34
|
+
const ref = yield* $(Ref.make<Option.Option<B>>(Option.none()))
|
|
35
35
|
|
|
36
36
|
yield* $(
|
|
37
37
|
pipe(
|
|
@@ -48,21 +48,17 @@ class SnapshotEffectFx<R, E, A, R2, E2, B, R3, E3, C>
|
|
|
48
48
|
fx.run(
|
|
49
49
|
Fx.Sink(
|
|
50
50
|
(a) =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Effect.matchCauseEffect(sink.error, sink.event),
|
|
63
|
-
Effect.as(Option.some(b)),
|
|
64
|
-
),
|
|
65
|
-
),
|
|
51
|
+
Ref.updateEffect(ref, (option) =>
|
|
52
|
+
pipe(
|
|
53
|
+
option,
|
|
54
|
+
Option.match(
|
|
55
|
+
() => Effect.sync(Option.none),
|
|
56
|
+
(b) =>
|
|
57
|
+
pipe(
|
|
58
|
+
f(b, a),
|
|
59
|
+
Effect.matchCauseEffect(sink.error, sink.event),
|
|
60
|
+
Effect.as(Option.some(b)),
|
|
61
|
+
),
|
|
66
62
|
),
|
|
67
63
|
),
|
|
68
64
|
),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
5
|
import { millis } from '@fp-ts/data/Duration'
|
|
5
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { periodic } from '../constructor/periodic.js'
|
|
@@ -22,7 +22,7 @@ describe(import.meta.url, () => {
|
|
|
22
22
|
}),
|
|
23
23
|
collectAll,
|
|
24
24
|
)
|
|
25
|
-
const events = await Effect.
|
|
25
|
+
const events = await Effect.runPromise(test)
|
|
26
26
|
|
|
27
27
|
deepStrictEqual(events, [
|
|
28
28
|
{ a: 1, b: 'a', c: true },
|
package/src/operator/struct.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
5
|
import { millis } from '@fp-ts/data/Duration'
|
|
5
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -19,7 +19,7 @@ describe(import.meta.url, () => {
|
|
|
19
19
|
switchMap((n) => at(millis(40), n * n)),
|
|
20
20
|
collectAll,
|
|
21
21
|
)
|
|
22
|
-
const events = await Effect.
|
|
22
|
+
const events = await Effect.runPromise(test)
|
|
23
23
|
|
|
24
24
|
deepStrictEqual(events, [9])
|
|
25
25
|
})
|
|
@@ -2,7 +2,7 @@ import * as Cause from '@effect/io/Cause'
|
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
3
|
import * as Fiber from '@effect/io/Fiber'
|
|
4
4
|
import * as Ref from '@effect/io/Ref/Synchronized'
|
|
5
|
-
import { flow, pipe, identity } from '@fp-ts/
|
|
5
|
+
import { flow, pipe, identity } from '@fp-ts/core/Function'
|
|
6
6
|
|
|
7
7
|
import { Fx } from '../Fx.js'
|
|
8
8
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
@@ -2,9 +2,9 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Cause from '@effect/io/Cause'
|
|
4
4
|
import * as Effect from '@effect/io/Effect'
|
|
5
|
+
import * as Either from '@fp-ts/core/Either'
|
|
6
|
+
import { flow, pipe } from '@fp-ts/core/Function'
|
|
5
7
|
import { millis } from '@fp-ts/data/Duration'
|
|
6
|
-
import * as Either from '@fp-ts/data/Either'
|
|
7
|
-
import { flow, pipe } from '@fp-ts/data/Function'
|
|
8
8
|
import { describe, it } from 'vitest'
|
|
9
9
|
|
|
10
10
|
import { at } from '../constructor/at.js'
|
|
@@ -32,7 +32,7 @@ describe(import.meta.url, () => {
|
|
|
32
32
|
),
|
|
33
33
|
collectAll,
|
|
34
34
|
)
|
|
35
|
-
const events = await Effect.
|
|
35
|
+
const events = await Effect.runPromise(test)
|
|
36
36
|
|
|
37
37
|
deepStrictEqual(events, [9])
|
|
38
38
|
})
|
|
@@ -2,7 +2,7 @@ import type * as Cause from '@effect/io/Cause'
|
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
3
|
import * as Fiber from '@effect/io/Fiber'
|
|
4
4
|
import * as Ref from '@effect/io/Ref/Synchronized'
|
|
5
|
-
import { flow, pipe } from '@fp-ts/
|
|
5
|
+
import { flow, pipe } from '@fp-ts/core/Function'
|
|
6
6
|
|
|
7
7
|
import { Fx } from '../Fx.js'
|
|
8
8
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
2
|
import type * as Effect from '@effect/io/Effect'
|
|
3
|
-
import { match } from '@fp-ts/
|
|
4
|
-
import { flow, pipe } from '@fp-ts/
|
|
3
|
+
import { match } from '@fp-ts/core/Either'
|
|
4
|
+
import { flow, pipe } from '@fp-ts/core/Function'
|
|
5
5
|
|
|
6
6
|
import type { Fx } from '../Fx.js'
|
|
7
7
|
import { failCause } from '../constructor/failCause.js'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
5
|
import { millis } from '@fp-ts/data/Duration'
|
|
5
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -29,7 +29,7 @@ describe(import.meta.url, () => {
|
|
|
29
29
|
),
|
|
30
30
|
collectAll,
|
|
31
31
|
)
|
|
32
|
-
const events = await Effect.
|
|
32
|
+
const events = await Effect.runPromise(test)
|
|
33
33
|
|
|
34
34
|
deepStrictEqual(events, [16])
|
|
35
35
|
})
|
|
@@ -2,8 +2,8 @@ import * as Cause from '@effect/io/Cause'
|
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
3
|
import * as Fiber from '@effect/io/Fiber'
|
|
4
4
|
import * as Ref from '@effect/io/Ref/Synchronized'
|
|
5
|
-
import
|
|
6
|
-
import { flow, pipe } from '@fp-ts/
|
|
5
|
+
import * as Either from '@fp-ts/core/Either'
|
|
6
|
+
import { flow, pipe } from '@fp-ts/core/Function'
|
|
7
7
|
|
|
8
8
|
import { Fx } from '../Fx.js'
|
|
9
9
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
@@ -20,7 +20,7 @@ export function switchMatchError<E, R2, E2, B, A, R3, E3, C>(
|
|
|
20
20
|
f: (error: E) => Fx<R2, E2, B>,
|
|
21
21
|
g: (a: A) => Fx<R3, E3, C>,
|
|
22
22
|
): <R>(fx: Fx<R, E, A>) => Fx<R | R2 | R3, E2 | E3, B | C> {
|
|
23
|
-
return switchMatchCause(flow(Cause.failureOrCause,
|
|
23
|
+
return switchMatchCause(flow(Cause.failureOrCause, Either.match(f, failCause)), g)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
class SwitchMatchFx<R, E, A, R2, E2, B, R3, E3, C>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
-
import { pipe } from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
5
|
import { describe, it } from 'vitest'
|
|
6
6
|
|
|
7
7
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -17,7 +17,7 @@ describe(import.meta.url, () => {
|
|
|
17
17
|
takeUntil((x) => x === 4),
|
|
18
18
|
collectAll,
|
|
19
19
|
)
|
|
20
|
-
const events = await Effect.
|
|
20
|
+
const events = await Effect.runPromise(test)
|
|
21
21
|
|
|
22
22
|
deepStrictEqual(events, [1, 2, 3])
|
|
23
23
|
})
|
package/src/operator/tap.ts
CHANGED
package/src/operator/tapCause.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
|
-
import { pipe } from '@fp-ts/
|
|
4
|
-
import { match } from '@fp-ts/
|
|
3
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
|
+
import { match } from '@fp-ts/core/Option'
|
|
5
5
|
|
|
6
6
|
import type { Fx } from '../Fx.js'
|
|
7
7
|
|
package/src/operator/tapError.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
|
-
import { match } from '@fp-ts/
|
|
4
|
-
import { pipe } from '@fp-ts/
|
|
3
|
+
import { match } from '@fp-ts/core/Either'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
5
|
|
|
6
6
|
import type { Fx } from '../Fx.js'
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
5
|
import * as Duration from '@fp-ts/data/Duration'
|
|
5
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -14,7 +14,7 @@ describe(import.meta.url, () => {
|
|
|
14
14
|
describe(throttle.name, () => {
|
|
15
15
|
it('filters noisy streams, favoring the initial', async () => {
|
|
16
16
|
const test = pipe(fromArray([1, 2, 3]), throttle(Duration.millis(10)), collectAll)
|
|
17
|
-
const events = await Effect.
|
|
17
|
+
const events = await Effect.runPromise(test)
|
|
18
18
|
|
|
19
19
|
deepStrictEqual(events, [1])
|
|
20
20
|
})
|
package/src/operator/throttle.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Effect from '@effect/io/Effect'
|
|
2
2
|
import type * as Fiber from '@effect/io/Fiber'
|
|
3
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
3
4
|
import type * as Duration from '@fp-ts/data/Duration'
|
|
4
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
5
5
|
|
|
6
6
|
import type { Fx } from '../Fx.js'
|
|
7
7
|
import { suspend } from '../constructor/suspend.js'
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import type { Effect } from '@effect/io/Effect'
|
|
1
|
+
import type { Effect, Semaphore } from '@effect/io/Effect'
|
|
2
2
|
import type { Scope } from '@effect/io/Scope'
|
|
3
|
-
import
|
|
4
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
3
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
4
|
|
|
6
5
|
import { Fx } from '../Fx.js'
|
|
7
6
|
|
|
8
|
-
export function withPermit(semaphore:
|
|
7
|
+
export function withPermit(semaphore: Semaphore) {
|
|
9
8
|
return <R, E, A>(fx: Fx<R, E, A>): Fx<R, E, A> => new WithPermitFx(fx, semaphore)
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
class WithPermitFx<R, E, A> extends Fx.Variance<R, E, A> implements Fx<R, E, A> {
|
|
13
|
-
constructor(readonly fx: Fx<R, E, A>, readonly semaphore:
|
|
12
|
+
constructor(readonly fx: Fx<R, E, A>, readonly semaphore: Semaphore) {
|
|
14
13
|
super()
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
run<R2>(sink: Fx.Sink<R2, E, A>): Effect<R | R2 | Scope, never, unknown> {
|
|
18
|
-
return pipe(this.fx.run(sink),
|
|
17
|
+
return pipe(this.fx.run(sink), this.semaphore.withPermits(1))
|
|
19
18
|
}
|
|
20
19
|
}
|
package/src/operator/zip.test.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
5
|
import { millis } from '@fp-ts/data/Duration'
|
|
5
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -22,7 +22,7 @@ describe(import.meta.url, () => {
|
|
|
22
22
|
),
|
|
23
23
|
collectAll,
|
|
24
24
|
)
|
|
25
|
-
const events = await Effect.
|
|
25
|
+
const events = await Effect.runPromise(test)
|
|
26
26
|
|
|
27
27
|
deepStrictEqual(events, [[2, 4, 5]])
|
|
28
28
|
})
|
package/src/operator/zip.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { deepStrictEqual } from 'assert'
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
|
-
import { pipe } from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
5
|
import { describe, it } from 'vitest'
|
|
6
6
|
|
|
7
7
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -17,7 +17,7 @@ describe(import.meta.url, () => {
|
|
|
17
17
|
zipItems([3, 4], (x, y) => x + y),
|
|
18
18
|
collectAll,
|
|
19
19
|
)
|
|
20
|
-
const events = await Effect.
|
|
20
|
+
const events = await Effect.runPromise(test)
|
|
21
21
|
|
|
22
22
|
deepStrictEqual(events, [4, 6])
|
|
23
23
|
})
|
package/src/run/collectAll.ts
CHANGED
package/src/run/collectN.ts
CHANGED
package/src/run/drain.ts
CHANGED
|
@@ -4,4 +4,6 @@ import type { Fx } from '../Fx.js'
|
|
|
4
4
|
|
|
5
5
|
import { observe } from './observe.js'
|
|
6
6
|
|
|
7
|
-
export const drain: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, void> = observe(
|
|
7
|
+
export const drain: <R, E, A>(fx: Fx<R, E, A>) => Effect.Effect<R, E, void> = observe(() =>
|
|
8
|
+
Effect.unit(),
|
|
9
|
+
)
|
package/src/run/observe.ts
CHANGED
package/src/run/reduce.ts
CHANGED