@typed/fx 1.0.10 → 1.0.12
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 +2 -2
- 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 +2 -2
- 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
package/src/constructor/sync.ts
CHANGED
package/src/operator/catchAll.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
|
-
import { match } from '@fp-ts/
|
|
3
|
-
import { pipe } from '@fp-ts/
|
|
2
|
+
import { match } from '@fp-ts/core/Either'
|
|
3
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
4
|
|
|
5
5
|
import type { Fx } from '../Fx.js'
|
|
6
6
|
import { failCause } from '../constructor/failCause.js'
|
|
@@ -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 { fail } from '../constructor/fail.js'
|
|
@@ -18,7 +18,7 @@ describe(import.meta.url, () => {
|
|
|
18
18
|
catchAllCause(() => fromArray([4, 5, 6])),
|
|
19
19
|
collectAll,
|
|
20
20
|
)
|
|
21
|
-
const events = await Effect.
|
|
21
|
+
const events = await Effect.runPromise(test)
|
|
22
22
|
|
|
23
23
|
deepStrictEqual(events, [4, 5, 6])
|
|
24
24
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
|
-
import { pipe } from '@fp-ts/
|
|
3
|
-
import { match } from '@fp-ts/
|
|
2
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
3
|
+
import { match } from '@fp-ts/core/Option'
|
|
4
4
|
|
|
5
5
|
import type { Fx } from '../Fx.js'
|
|
6
6
|
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'
|
|
@@ -24,7 +24,7 @@ describe(import.meta.url, () => {
|
|
|
24
24
|
),
|
|
25
25
|
collectAll,
|
|
26
26
|
)
|
|
27
|
-
const events = await Effect.
|
|
27
|
+
const events = await Effect.runPromise(test)
|
|
28
28
|
|
|
29
29
|
deepStrictEqual(events, [
|
|
30
30
|
[1, 2, 3, 4, 5],
|
package/src/operator/combine.ts
CHANGED
package/src/operator/compact.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'
|
|
@@ -20,7 +20,7 @@ describe(import.meta.url, () => {
|
|
|
20
20
|
concatMap((n) => mergeAll(at(millis(0), n), at(millis(10), n * n))),
|
|
21
21
|
collectAll,
|
|
22
22
|
)
|
|
23
|
-
const events = await Effect.
|
|
23
|
+
const events = await Effect.runPromise(test)
|
|
24
24
|
|
|
25
25
|
deepStrictEqual(events, [1, 1, 2, 4, 3, 9])
|
|
26
26
|
})
|
|
@@ -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
|
continueWith(() => fromArray([4, 5, 6])),
|
|
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, 4, 5, 6])
|
|
23
23
|
})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as Effect from '@effect/io/Effect'
|
|
2
|
+
import type { Scope } from '@effect/io/Scope'
|
|
3
|
+
import * as Context from '@fp-ts/data/Context'
|
|
4
|
+
|
|
5
|
+
import { Fx } from '../Fx.js'
|
|
6
|
+
|
|
7
|
+
export function provideSomeContext<R2>(context: Context.Context<R2>) {
|
|
8
|
+
return <R, E, A>(self: Fx<R, E, A>): Fx<Exclude<R, R2>, E, A> =>
|
|
9
|
+
new ContramapContextFx(self, (ctx) => Context.merge(context)(ctx as Context.Context<R>))
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function contramapContext<R2, R>(f: (ctx: Context.Context<R2>) => Context.Context<R>) {
|
|
13
|
+
return <E, A>(self: Fx<R, E, A>): Fx<R2, E, A> => new ContramapContextFx(self, f)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class ContramapContextFx<R, R2, E, A> extends Fx.Variance<R2, E, A> implements Fx<R2, E, A> {
|
|
17
|
+
constructor(
|
|
18
|
+
readonly self: Fx<R, E, A>,
|
|
19
|
+
readonly f: (ctx: Context.Context<R2>) => Context.Context<R>,
|
|
20
|
+
) {
|
|
21
|
+
super()
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
run<R3>(sink: Fx.Sink<R3, E, A>) {
|
|
25
|
+
const { self, f } = this
|
|
26
|
+
|
|
27
|
+
return Effect.gen(function* ($) {
|
|
28
|
+
const ctx = yield* $(Effect.context<R2 | R3 | Scope>())
|
|
29
|
+
const context = Context.merge(f(ctx))(ctx)
|
|
30
|
+
|
|
31
|
+
return yield* $(Effect.provideContext(context)(self.run(sink)))
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -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(debounce.name, () => {
|
|
15
15
|
it('filters noisy streams, favoring the latest', async () => {
|
|
16
16
|
const test = pipe(fromArray([1, 2, 3]), debounce(Duration.millis(10)), collectAll)
|
|
17
|
-
const events = await Effect.
|
|
17
|
+
const events = await Effect.runPromise(test)
|
|
18
18
|
|
|
19
19
|
deepStrictEqual(events, [3])
|
|
20
20
|
})
|
package/src/operator/debounce.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 Fiber from '@effect/io/Fiber'
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
5
|
import type * as Duration from '@fp-ts/data/Duration'
|
|
5
|
-
import { pipe } from '@fp-ts/data/Function'
|
|
6
6
|
|
|
7
7
|
import { Fx } from '../Fx.js'
|
|
8
8
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
package/src/operator/delay.ts
CHANGED
package/src/operator/during.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 * 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 { fromIterable } from '../constructor/fromIterable.js'
|
|
@@ -18,7 +18,7 @@ describe(import.meta.url, () => {
|
|
|
18
18
|
fromIterable([1, 2, 3]),
|
|
19
19
|
exhaustMap((n) => delay(Duration.millis(10))(fromIterable([n, n, n]))),
|
|
20
20
|
collectAll,
|
|
21
|
-
Effect.
|
|
21
|
+
Effect.runPromise,
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
deepStrictEqual(result, [1, 1, 1])
|
|
@@ -2,7 +2,7 @@ import * as Cause from '@effect/io/Cause'
|
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
3
|
import type * as Fiber from '@effect/io/Fiber'
|
|
4
4
|
import * as Ref from '@effect/io/Ref/Synchronized'
|
|
5
|
-
import { pipe } from '@fp-ts/
|
|
5
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
6
6
|
|
|
7
7
|
import { Fx } from '../Fx.js'
|
|
8
8
|
import { withRefCounter } from '../_internal/RefCounter.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 * 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 { fromIterable } from '../constructor/fromIterable.js'
|
|
@@ -18,7 +18,7 @@ describe(import.meta.url, () => {
|
|
|
18
18
|
fromIterable([1, 2, 3]),
|
|
19
19
|
exhaustMapLatest((n) => delay(Duration.millis(10))(fromIterable([n, n, n]))),
|
|
20
20
|
collectAll,
|
|
21
|
-
Effect.
|
|
21
|
+
Effect.runPromise,
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
deepStrictEqual(result, [1, 1, 1, 3, 3, 3])
|
|
@@ -3,7 +3,7 @@ import * as Effect from '@effect/io/Effect'
|
|
|
3
3
|
import type * as Fiber from '@effect/io/Fiber'
|
|
4
4
|
import * as Ref from '@effect/io/Ref/Synchronized'
|
|
5
5
|
import type { Scope } from '@effect/io/Scope'
|
|
6
|
-
import { pipe } from '@fp-ts/
|
|
6
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
7
7
|
|
|
8
8
|
import { Fx } from '../Fx.js'
|
|
9
9
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
@@ -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
|
filter((x) => x % 2 === 0),
|
|
18
18
|
collectAll,
|
|
19
19
|
)
|
|
20
|
-
const events = await Effect.
|
|
20
|
+
const events = await Effect.runPromise(test)
|
|
21
21
|
|
|
22
22
|
deepStrictEqual(events, [2, 4])
|
|
23
23
|
})
|
package/src/operator/filter.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
|
filterEffect((x) => Effect.sync(() => x % 2 === 0)),
|
|
18
18
|
collectAll,
|
|
19
19
|
)
|
|
20
|
-
const events = await Effect.
|
|
20
|
+
const events = await Effect.runPromise(test)
|
|
21
21
|
|
|
22
22
|
deepStrictEqual(events, [2, 4])
|
|
23
23
|
})
|
|
@@ -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/
|
|
5
|
-
import { none, some } from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
+
import { none, some } from '@fp-ts/core/Option'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -15,10 +15,10 @@ describe(import.meta.url, () => {
|
|
|
15
15
|
it('filters and transforms an Fx', async () => {
|
|
16
16
|
const test = pipe(
|
|
17
17
|
fromArray([1, 2, 3]),
|
|
18
|
-
filterMap((n) => (n % 2 === 0 ? some(n + 1) : none)),
|
|
18
|
+
filterMap((n) => (n % 2 === 0 ? some(n + 1) : none())),
|
|
19
19
|
collectAll,
|
|
20
20
|
)
|
|
21
|
-
const events = await Effect.
|
|
21
|
+
const events = await Effect.runPromise(test)
|
|
22
22
|
|
|
23
23
|
deepStrictEqual(events, [3])
|
|
24
24
|
})
|
|
@@ -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/
|
|
5
|
-
import { none, some } from '@fp-ts/
|
|
4
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
+
import { none, some } from '@fp-ts/core/Option'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -15,10 +15,10 @@ describe(import.meta.url, () => {
|
|
|
15
15
|
it('filters and transforms an Fx', async () => {
|
|
16
16
|
const test = pipe(
|
|
17
17
|
fromArray([1, 2, 3]),
|
|
18
|
-
filterMapEffect((n) => Effect.sync(() => (n % 2 === 0 ? some(n + 1) : none))),
|
|
18
|
+
filterMapEffect((n) => Effect.sync(() => (n % 2 === 0 ? some(n + 1) : none()))),
|
|
19
19
|
collectAll,
|
|
20
20
|
)
|
|
21
|
-
const events = await Effect.
|
|
21
|
+
const events = await Effect.runPromise(test)
|
|
22
22
|
|
|
23
23
|
deepStrictEqual(events, [3])
|
|
24
24
|
})
|
|
@@ -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
|
flatMap((n) => fromArray([n * 2, n + 1])),
|
|
20
20
|
collectAll,
|
|
21
21
|
)
|
|
22
|
-
const events = await Effect.
|
|
22
|
+
const events = await Effect.runPromise(test)
|
|
23
23
|
|
|
24
24
|
deepStrictEqual(events, [2, 2, 4, 3, 6, 4])
|
|
25
25
|
})
|
|
@@ -30,7 +30,7 @@ describe(import.meta.url, () => {
|
|
|
30
30
|
flatMap((n) => at(millis(10), n * 2)),
|
|
31
31
|
collectAll,
|
|
32
32
|
)
|
|
33
|
-
const events = await Effect.
|
|
33
|
+
const events = await Effect.runPromise(test)
|
|
34
34
|
|
|
35
35
|
deepStrictEqual(events, [2, 4, 6])
|
|
36
36
|
})
|
package/src/operator/flatMap.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
|
-
import { identity, pipe } from '@fp-ts/
|
|
3
|
+
import { identity, pipe } from '@fp-ts/core/Function'
|
|
4
4
|
|
|
5
5
|
import { Fx } from '../Fx.js'
|
|
6
6
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Cause from '@effect/io/Cause'
|
|
2
2
|
import * as Effect from '@effect/io/Effect'
|
|
3
|
-
import { pipe } from '@fp-ts/
|
|
3
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
4
4
|
|
|
5
5
|
import { Fx } from '../Fx.js'
|
|
6
6
|
import { withRefCounter } from '../_internal/RefCounter.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'
|
|
@@ -20,7 +20,7 @@ describe(import.meta.url, () => {
|
|
|
20
20
|
flatMapConcurrently(2, (n) => mergeAll(at(millis(50), n), at(millis(100), n * n))),
|
|
21
21
|
collectAll,
|
|
22
22
|
)
|
|
23
|
-
const events = await Effect.
|
|
23
|
+
const events = await Effect.runPromise(test)
|
|
24
24
|
|
|
25
25
|
deepStrictEqual(events, [1, 2, 1, 4, 3, 4, 9, 16])
|
|
26
26
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { flow, pipe } from '@fp-ts/
|
|
1
|
+
import { unsafeMakeSemaphore } from '@effect/io/Effect'
|
|
2
|
+
import { flow, pipe } from '@fp-ts/core/Function'
|
|
3
3
|
|
|
4
4
|
import type { Fx } from '../Fx.js'
|
|
5
5
|
import { suspend } from '../constructor/suspend.js'
|
|
@@ -10,7 +10,7 @@ import { withPermit } from './withPermit.js'
|
|
|
10
10
|
export function flatMapConcurrently<A, R2, E2, B>(concurrency: number, f: (a: A) => Fx<R2, E2, B>) {
|
|
11
11
|
return <R, E>(stream: Fx<R, E, A>): Fx<R | R2, E | E2, B> =>
|
|
12
12
|
suspend(() => {
|
|
13
|
-
const semaphore =
|
|
13
|
+
const semaphore = unsafeMakeSemaphore(concurrency)
|
|
14
14
|
|
|
15
15
|
return pipe(stream, flatMap(flow(f, withPermit(semaphore))))
|
|
16
16
|
})
|
package/src/operator/hold.ts
CHANGED
|
@@ -2,9 +2,9 @@ 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 type { Scope } from '@effect/io/Scope'
|
|
5
|
-
import { pipe } from '@fp-ts/
|
|
5
|
+
import { pipe } from '@fp-ts/core/Function'
|
|
6
|
+
import * as Option from '@fp-ts/core/Option'
|
|
6
7
|
import * as MutableRef from '@fp-ts/data/MutableRef'
|
|
7
|
-
import * as Option from '@fp-ts/data/Option'
|
|
8
8
|
|
|
9
9
|
import type { Fx } from '../Fx.js'
|
|
10
10
|
import { asap } from '../_internal/RefCounter.js'
|
|
@@ -12,7 +12,7 @@ import { asap } from '../_internal/RefCounter.js'
|
|
|
12
12
|
import { MulticastFx } from './multicast.js'
|
|
13
13
|
|
|
14
14
|
export function hold<R, E, A>(fx: Fx<R, E, A>): Fx<R, E, A> {
|
|
15
|
-
return new HoldFx(fx, MutableRef.make(Option.none))
|
|
15
|
+
return new HoldFx(fx, MutableRef.make(Option.none()))
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export function hold_<R, E, A>(fx: Fx<R, E, A>, value: MutableRef.MutableRef<Option.Option<A>>) {
|
package/src/operator/index.ts
CHANGED
|
@@ -38,11 +38,11 @@ export * from './onError.js'
|
|
|
38
38
|
export * from './onExit.js'
|
|
39
39
|
export * from './onInterrupt.js'
|
|
40
40
|
export * from './orElse.js'
|
|
41
|
-
export * from './
|
|
41
|
+
export * from './provideContext.js'
|
|
42
42
|
export * from './provideLayer.js'
|
|
43
43
|
export * from './provideService.js'
|
|
44
44
|
export * from './provideServiceEffect.js'
|
|
45
|
-
export * from './
|
|
45
|
+
export * from './contramapContext.js'
|
|
46
46
|
export * from './provideSomeLayer.js'
|
|
47
47
|
export * from './race.js'
|
|
48
48
|
export * from './sample.js'
|
|
@@ -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
|
loop(0, (acc, n) => [(acc + n).toString(), acc + n]),
|
|
18
18
|
collectAll,
|
|
19
19
|
)
|
|
20
|
-
const events = await Effect.
|
|
20
|
+
const events = await Effect.runPromise(test)
|
|
21
21
|
|
|
22
22
|
deepStrictEqual(events, ['1', '3', '6'])
|
|
23
23
|
})
|
package/src/operator/map.test.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
|
map((x) => x + 1),
|
|
18
18
|
collectAll,
|
|
19
19
|
)
|
|
20
|
-
const events = await Effect.
|
|
20
|
+
const events = await Effect.runPromise(test)
|
|
21
21
|
|
|
22
22
|
deepStrictEqual(events, [2, 3, 4])
|
|
23
23
|
})
|