@typed/fx 1.0.15 → 1.0.16
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/dist/Fx.d.ts +6 -0
- package/dist/Fx.d.ts.map +1 -1
- package/dist/Fx.js.map +1 -1
- package/dist/Subject/HoldSubject.d.ts +1 -1
- package/dist/Subject/HoldSubject.d.ts.map +1 -1
- package/dist/Subject/HoldSubject.js +1 -1
- package/dist/Subject/HoldSubject.js.map +1 -1
- package/dist/Subject/RefSubject.js +2 -2
- package/dist/Subject/RefSubject.js.map +1 -1
- package/dist/Subject/SynchronizedSubject.js +2 -2
- package/dist/Subject/SynchronizedSubject.js.map +1 -1
- package/dist/_internal/RefCounter.js +1 -1
- package/dist/_internal/RefCounter.js.map +1 -1
- package/dist/constructor/at.d.ts +1 -1
- package/dist/constructor/at.d.ts.map +1 -1
- package/dist/constructor/periodic.d.ts +1 -1
- package/dist/constructor/periodic.d.ts.map +1 -1
- package/dist/constructor/service.d.ts +1 -1
- package/dist/constructor/service.d.ts.map +1 -1
- package/dist/constructor/serviceWith.d.ts +1 -1
- package/dist/constructor/serviceWith.d.ts.map +1 -1
- package/dist/constructor/serviceWithEffect.d.ts +1 -1
- package/dist/constructor/serviceWithEffect.d.ts.map +1 -1
- package/dist/constructor/serviceWithFx.d.ts +1 -1
- package/dist/constructor/serviceWithFx.d.ts.map +1 -1
- package/dist/operator/contramapContext.d.ts +1 -1
- package/dist/operator/contramapContext.d.ts.map +1 -1
- package/dist/operator/contramapContext.js +1 -1
- package/dist/operator/contramapContext.js.map +1 -1
- package/dist/operator/debounce.d.ts +1 -1
- package/dist/operator/debounce.d.ts.map +1 -1
- package/dist/operator/delay.d.ts +1 -1
- package/dist/operator/delay.d.ts.map +1 -1
- package/dist/operator/exhaustMap.d.ts +3 -2
- package/dist/operator/exhaustMap.d.ts.map +1 -1
- package/dist/operator/exhaustMap.js +2 -4
- package/dist/operator/exhaustMap.js.map +1 -1
- package/dist/operator/flatMap.d.ts +3 -1
- package/dist/operator/flatMap.d.ts.map +1 -1
- package/dist/operator/flatMap.js +2 -4
- package/dist/operator/flatMap.js.map +1 -1
- package/dist/operator/hold.d.ts +1 -1
- package/dist/operator/hold.d.ts.map +1 -1
- package/dist/operator/hold.js +1 -1
- package/dist/operator/hold.js.map +1 -1
- package/dist/operator/map.d.ts +4 -1
- package/dist/operator/map.d.ts.map +1 -1
- package/dist/operator/map.js +2 -3
- package/dist/operator/map.js.map +1 -1
- package/dist/operator/multicast.d.ts +1 -1
- package/dist/operator/multicast.d.ts.map +1 -1
- package/dist/operator/onInterrupt.d.ts +1 -1
- package/dist/operator/onInterrupt.d.ts.map +1 -1
- package/dist/operator/provideContext.d.ts +1 -1
- package/dist/operator/provideContext.d.ts.map +1 -1
- package/dist/operator/provideContext.js +1 -1
- package/dist/operator/provideContext.js.map +1 -1
- package/dist/operator/provideService.d.ts +1 -1
- package/dist/operator/provideService.d.ts.map +1 -1
- package/dist/operator/provideServiceEffect.d.ts +1 -1
- package/dist/operator/provideServiceEffect.d.ts.map +1 -1
- package/dist/operator/skipRepeats.js +1 -1
- package/dist/operator/skipRepeats.js.map +1 -1
- package/dist/operator/switchMap.d.ts +3 -1
- package/dist/operator/switchMap.d.ts.map +1 -1
- package/dist/operator/switchMap.js +2 -4
- package/dist/operator/switchMap.js.map +1 -1
- package/dist/operator/throttle.d.ts +1 -1
- package/dist/operator/throttle.d.ts.map +1 -1
- package/dist/typeclass/Bicovariant.d.ts +1 -0
- package/dist/typeclass/Bicovariant.d.ts.map +1 -1
- package/dist/typeclass/Bicovariant.js +3 -2
- package/dist/typeclass/Bicovariant.js.map +1 -1
- package/dist/typeclass/Covariant.d.ts.map +1 -1
- package/dist/typeclass/Covariant.js +4 -1
- package/dist/typeclass/Covariant.js.map +1 -1
- package/dist/typeclass/SemiProduct.d.ts +3 -0
- package/dist/typeclass/SemiProduct.d.ts.map +1 -1
- package/dist/typeclass/SemiProduct.js +5 -2
- package/dist/typeclass/SemiProduct.js.map +1 -1
- package/package.json +5 -5
- package/src/Fx.ts +6 -0
- package/src/Subject/HoldSubject.test.ts +1 -1
- package/src/Subject/HoldSubject.ts +1 -1
- package/src/Subject/RefSubject.ts +2 -2
- package/src/Subject/SynchronizedSubject.ts +2 -2
- package/src/_internal/RefCounter.ts +1 -1
- package/src/constructor/at.ts +1 -1
- package/src/constructor/periodic.ts +1 -1
- package/src/constructor/service.ts +1 -1
- package/src/constructor/serviceWith.ts +1 -1
- package/src/constructor/serviceWithEffect.ts +1 -1
- package/src/constructor/serviceWithFx.ts +1 -1
- package/src/operator/combine.test.ts +1 -1
- package/src/operator/concatMap.test.ts +1 -1
- package/src/operator/contramapContext.ts +1 -1
- package/src/operator/debounce.test.ts +1 -1
- package/src/operator/debounce.ts +1 -1
- package/src/operator/delay.ts +1 -1
- package/src/operator/exhaustMap.test.ts +1 -1
- package/src/operator/exhaustMap.ts +7 -4
- package/src/operator/exhaustMapLatest.test.ts +1 -1
- package/src/operator/flatMap.test.ts +1 -1
- package/src/operator/flatMap.ts +7 -6
- package/src/operator/flatMapConcurrently.test.ts +1 -1
- package/src/operator/hold.test.ts +1 -1
- package/src/operator/hold.ts +1 -1
- package/src/operator/map.ts +6 -3
- package/src/operator/merge.test.ts +1 -1
- package/src/operator/mergeRace.test.ts +1 -1
- package/src/operator/multicast.test.ts +1 -1
- package/src/operator/multicast.ts +1 -1
- package/src/operator/onInterrupt.ts +1 -1
- package/src/operator/provideContext.ts +1 -1
- package/src/operator/provideService.test.ts +1 -1
- package/src/operator/provideService.ts +1 -1
- package/src/operator/provideServiceEffect.test.ts +1 -1
- package/src/operator/provideServiceEffect.ts +1 -1
- package/src/operator/race.test.ts +1 -1
- package/src/operator/race.ts +1 -1
- package/src/operator/scanEffect.test.ts +1 -1
- package/src/operator/separate.test.ts +1 -1
- package/src/operator/skipRepeats.ts +1 -1
- package/src/operator/snapshot.test.ts +1 -1
- package/src/operator/snapshotEffect.test.ts +1 -1
- package/src/operator/struct.test.ts +1 -1
- package/src/operator/switchMap.test.ts +1 -1
- package/src/operator/switchMap.ts +7 -6
- package/src/operator/switchMapCause.test.ts +1 -1
- package/src/operator/switchMatch.test.ts +1 -1
- package/src/operator/throttle.test.ts +1 -1
- package/src/operator/throttle.ts +1 -1
- package/src/operator/zip.test.ts +1 -1
- package/src/typeclass/Bicovariant.ts +8 -2
- package/src/typeclass/Covariant.ts +4 -1
- package/src/typeclass/SemiProduct.ts +11 -5
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { Tag } from '@
|
|
5
|
+
import { Tag } from '@effect/data/Context'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { serviceWith } from '../constructor/serviceWith.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Effect from '@effect/io/Effect'
|
|
2
2
|
import type { Scope } from '@effect/io/Scope'
|
|
3
3
|
import { pipe } from '@fp-ts/core/Function'
|
|
4
|
-
import type * as Context from '@
|
|
4
|
+
import type * as Context from '@effect/data/Context'
|
|
5
5
|
|
|
6
6
|
import { Fx } from '../Fx.js'
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { millis } from '@
|
|
5
|
+
import { millis } from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
package/src/operator/race.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as ExecutionStrategy from '@effect/io/ExecutionStrategy'
|
|
|
4
4
|
import * as Exit from '@effect/io/Exit'
|
|
5
5
|
import * as Scope from '@effect/io/Scope'
|
|
6
6
|
import { pipe } from '@fp-ts/core/Function'
|
|
7
|
-
import type { Chunk } from '@
|
|
7
|
+
import type { Chunk } from '@effect/data/Chunk'
|
|
8
8
|
|
|
9
9
|
import { Fx } from '../Fx.js'
|
|
10
10
|
import { asap } from '../_internal/RefCounter.js'
|
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { millis } from '@
|
|
5
|
+
import { millis } from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { fromArray } from '../constructor/fromArray.js'
|
|
@@ -3,7 +3,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import * as Fiber from '@effect/io/Fiber'
|
|
5
5
|
import * as Either from '@fp-ts/core/Either'
|
|
6
|
-
import { millis } from '@
|
|
6
|
+
import { millis } from '@effect/data/Duration'
|
|
7
7
|
import { describe, it } from 'vitest'
|
|
8
8
|
|
|
9
9
|
import { at } from '../constructor/at.js'
|
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { millis } from '@
|
|
5
|
+
import { millis } from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { millis } from '@
|
|
5
|
+
import { millis } from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { millis } from '@
|
|
5
|
+
import { millis } from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { periodic } from '../constructor/periodic.js'
|
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { millis } from '@
|
|
5
|
+
import { millis } from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -2,16 +2,17 @@ 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/core/Function'
|
|
5
|
+
import { flow, pipe, identity, dual } from '@fp-ts/core/Function'
|
|
6
|
+
import type { FlatMap } from '@fp-ts/core/typeclass/FlatMap'
|
|
6
7
|
|
|
7
8
|
import { Fx } from '../Fx.js'
|
|
8
9
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
10
|
+
import type { FxTypeLambda } from '../typeclass/TypeLambda.js'
|
|
9
11
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
12
|
+
export const switchMap: FlatMap<FxTypeLambda>['flatMap'] = dual(
|
|
13
|
+
2,
|
|
14
|
+
<R, E, A, R2, E2, B>(fx: Fx<R, E, A>, f: (a: A) => Fx<R2, E2, B>) => new SwitchMapFx(fx, f),
|
|
15
|
+
)
|
|
15
16
|
|
|
16
17
|
export const switchLatest: <R, E, R2, E2, A>(fx: Fx<R, E, Fx<R2, E2, A>>) => Fx<R | R2, E | E2, A> =
|
|
17
18
|
switchMap(identity)
|
|
@@ -4,7 +4,7 @@ import * as Cause from '@effect/io/Cause'
|
|
|
4
4
|
import * as Effect from '@effect/io/Effect'
|
|
5
5
|
import * as Either from '@fp-ts/core/Either'
|
|
6
6
|
import { flow, pipe } from '@fp-ts/core/Function'
|
|
7
|
-
import { millis } from '@
|
|
7
|
+
import { millis } from '@effect/data/Duration'
|
|
8
8
|
import { describe, it } from 'vitest'
|
|
9
9
|
|
|
10
10
|
import { at } from '../constructor/at.js'
|
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { millis } from '@
|
|
5
|
+
import { millis } from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import * as Duration from '@
|
|
5
|
+
import * as Duration from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { fromArray } from '../constructor/fromArray.js'
|
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
3
|
import { pipe } from '@fp-ts/core/Function'
|
|
4
|
-
import type * as Duration from '@
|
|
4
|
+
import type * as Duration from '@effect/data/Duration'
|
|
5
5
|
|
|
6
6
|
import type { Fx } from '../Fx.js'
|
|
7
7
|
import { suspend } from '../constructor/suspend.js'
|
package/src/operator/zip.test.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { deepStrictEqual } from 'assert'
|
|
|
2
2
|
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import { pipe } from '@fp-ts/core/Function'
|
|
5
|
-
import { millis } from '@
|
|
5
|
+
import { millis } from '@effect/data/Duration'
|
|
6
6
|
import { describe, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
import { at } from '../constructor/at.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pipe } from '@fp-ts/core/Function'
|
|
1
|
+
import { dual, pipe } from '@fp-ts/core/Function'
|
|
2
2
|
import * as B from '@fp-ts/core/typeclass/Bicovariant'
|
|
3
3
|
|
|
4
4
|
import type { Fx } from '../Fx.js'
|
|
@@ -7,8 +7,14 @@ import { mapError } from '../operator/mapError.js'
|
|
|
7
7
|
|
|
8
8
|
import type { FxTypeLambda } from './TypeLambda.js'
|
|
9
9
|
|
|
10
|
+
export const bimap: B.Bicovariant<FxTypeLambda>['bimap'] = dual(
|
|
11
|
+
3,
|
|
12
|
+
<R, E, A, E2, B>(self: Fx<R, E, A>, f: (e: E) => E2, g: (a: A) => B) =>
|
|
13
|
+
pipe(self, mapError(f), map(g)),
|
|
14
|
+
)
|
|
15
|
+
|
|
10
16
|
export const Bicovariant: B.Bicovariant<FxTypeLambda> = {
|
|
11
|
-
bimap
|
|
17
|
+
bimap,
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
export const mapLeft: <E1, E2>(f: (e: E1) => E2) => <R, A>(self: Fx<R, E1, A>) => Fx<R, E2, A> =
|
|
@@ -5,7 +5,10 @@ import { map } from '../operator/map.js'
|
|
|
5
5
|
|
|
6
6
|
import type { FxTypeLambda } from './TypeLambda.js'
|
|
7
7
|
|
|
8
|
-
export const Covariant: C.Covariant<FxTypeLambda> =
|
|
8
|
+
export const Covariant: C.Covariant<FxTypeLambda> = {
|
|
9
|
+
map,
|
|
10
|
+
imap: C.imap<FxTypeLambda>(map),
|
|
11
|
+
}
|
|
9
12
|
|
|
10
13
|
export const flap: <A>(a: A) => <R, E, B>(self: Fx<R, E, (a: A) => B>) => Fx<R, E, B> =
|
|
11
14
|
C.flap(Covariant)
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { dual } from '@fp-ts/core/Function'
|
|
1
2
|
import * as SP from '@fp-ts/core/typeclass/SemiProduct'
|
|
2
3
|
|
|
4
|
+
import type { Fx } from '../Fx.js'
|
|
3
5
|
import { combine } from '../operator/combine.js'
|
|
4
6
|
|
|
5
7
|
import { Covariant } from './Covariant.js'
|
|
6
8
|
import type { FxTypeLambda } from './TypeLambda.js'
|
|
7
9
|
|
|
10
|
+
export const product: SP.SemiProduct<FxTypeLambda>['product'] = dual(
|
|
11
|
+
2,
|
|
12
|
+
<R, E, A, R2, E2, B>(self: Fx<R, E, A>, that: Fx<R2, E2, B>) => combine(that)(self),
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export const productMany = SP.productMany<FxTypeLambda>(Covariant.map, product)
|
|
16
|
+
|
|
8
17
|
export const SemiProduct: SP.SemiProduct<FxTypeLambda> = {
|
|
9
|
-
product
|
|
10
|
-
productMany
|
|
11
|
-
Covariant,
|
|
12
|
-
(s, o) => combine(o)(s) as any,
|
|
13
|
-
) as SP.SemiProduct<FxTypeLambda>['productMany'],
|
|
18
|
+
product,
|
|
19
|
+
productMany,
|
|
14
20
|
imap: Covariant.imap,
|
|
15
21
|
}
|