@typed/fx 1.5.7 → 1.5.8
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/_internal/matchInterruptCause.d.ts +11 -0
- package/dist/_internal/matchInterruptCause.d.ts.map +1 -0
- package/dist/_internal/matchInterruptCause.js +6 -0
- package/dist/_internal/matchInterruptCause.js.map +1 -0
- package/dist/cjs/_internal/matchInterruptCause.d.ts +11 -0
- package/dist/cjs/_internal/matchInterruptCause.d.ts.map +1 -0
- package/dist/cjs/_internal/matchInterruptCause.js +32 -0
- package/dist/cjs/_internal/matchInterruptCause.js.map +1 -0
- package/dist/cjs/operator/combine.d.ts.map +1 -1
- package/dist/cjs/operator/combine.js +2 -1
- package/dist/cjs/operator/combine.js.map +1 -1
- package/dist/cjs/operator/debounce.d.ts.map +1 -1
- package/dist/cjs/operator/debounce.js +2 -2
- package/dist/cjs/operator/debounce.js.map +1 -1
- package/dist/cjs/operator/exhaustMap.js +2 -4
- package/dist/cjs/operator/exhaustMap.js.map +1 -1
- package/dist/cjs/operator/exhaustMapLatest.js +1 -1
- package/dist/cjs/operator/exhaustMapLatest.js.map +1 -1
- package/dist/cjs/operator/flatMap.js +1 -1
- package/dist/cjs/operator/flatMap.js.map +1 -1
- package/dist/cjs/operator/flatMapCause.js +1 -1
- package/dist/cjs/operator/flatMapCause.js.map +1 -1
- package/dist/cjs/operator/mergeRace.js +1 -1
- package/dist/cjs/operator/mergeRace.js.map +1 -1
- package/dist/cjs/operator/snapshot.js +1 -1
- package/dist/cjs/operator/snapshot.js.map +1 -1
- package/dist/cjs/operator/snapshotEffect.js +1 -1
- package/dist/cjs/operator/snapshotEffect.js.map +1 -1
- package/dist/cjs/operator/switchMap.d.ts.map +1 -1
- package/dist/cjs/operator/switchMap.js +3 -2
- package/dist/cjs/operator/switchMap.js.map +1 -1
- package/dist/cjs/operator/switchMapCause.d.ts.map +1 -1
- package/dist/cjs/operator/switchMapCause.js +2 -4
- package/dist/cjs/operator/switchMapCause.js.map +1 -1
- package/dist/cjs/operator/switchMatch.d.ts.map +1 -1
- package/dist/cjs/operator/switchMatch.js +2 -3
- package/dist/cjs/operator/switchMatch.js.map +1 -1
- package/dist/cjs/operator/zip.d.ts.map +1 -1
- package/dist/cjs/operator/zip.js +2 -1
- package/dist/cjs/operator/zip.js.map +1 -1
- package/dist/cjs/run/run.d.ts.map +1 -1
- package/dist/cjs/run/run.js +3 -2
- package/dist/cjs/run/run.js.map +1 -1
- package/dist/operator/combine.d.ts.map +1 -1
- package/dist/operator/combine.js +2 -1
- package/dist/operator/combine.js.map +1 -1
- package/dist/operator/debounce.d.ts.map +1 -1
- package/dist/operator/debounce.js +2 -2
- package/dist/operator/debounce.js.map +1 -1
- package/dist/operator/exhaustMap.js +2 -4
- package/dist/operator/exhaustMap.js.map +1 -1
- package/dist/operator/exhaustMapLatest.js +1 -1
- package/dist/operator/exhaustMapLatest.js.map +1 -1
- package/dist/operator/flatMap.js +1 -1
- package/dist/operator/flatMap.js.map +1 -1
- package/dist/operator/flatMapCause.js +1 -1
- package/dist/operator/flatMapCause.js.map +1 -1
- package/dist/operator/mergeRace.js +1 -1
- package/dist/operator/mergeRace.js.map +1 -1
- package/dist/operator/snapshot.js +1 -1
- package/dist/operator/snapshot.js.map +1 -1
- package/dist/operator/snapshotEffect.js +1 -1
- package/dist/operator/snapshotEffect.js.map +1 -1
- package/dist/operator/switchMap.d.ts.map +1 -1
- package/dist/operator/switchMap.js +3 -2
- package/dist/operator/switchMap.js.map +1 -1
- package/dist/operator/switchMapCause.d.ts.map +1 -1
- package/dist/operator/switchMapCause.js +3 -5
- package/dist/operator/switchMapCause.js.map +1 -1
- package/dist/operator/switchMatch.d.ts.map +1 -1
- package/dist/operator/switchMatch.js +2 -3
- package/dist/operator/switchMatch.js.map +1 -1
- package/dist/operator/zip.d.ts.map +1 -1
- package/dist/operator/zip.js +2 -1
- package/dist/operator/zip.js.map +1 -1
- package/dist/run/run.d.ts.map +1 -1
- package/dist/run/run.js +3 -2
- package/dist/run/run.js.map +1 -1
- package/dist/tsconfig.cjs.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/_internal/matchInterruptCause.ts +50 -0
- package/src/operator/combine.ts +2 -1
- package/src/operator/debounce.ts +6 -5
- package/src/operator/exhaustMap.ts +3 -5
- package/src/operator/exhaustMapLatest.ts +1 -1
- package/src/operator/flatMap.ts +1 -1
- package/src/operator/flatMapCause.ts +1 -1
- package/src/operator/mergeRace.ts +1 -1
- package/src/operator/snapshot.ts +1 -1
- package/src/operator/snapshotEffect.ts +1 -1
- package/src/operator/switchMap.ts +7 -0
- package/src/operator/switchMapCause.ts +3 -9
- package/src/operator/switchMatch.ts +4 -8
- package/src/operator/zip.ts +2 -1
- package/src/run/run.ts +4 -2
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { dualWithTrace } from '@effect/data/Debug'
|
|
2
|
+
import * as Cause from '@effect/io/Cause'
|
|
3
|
+
import * as Effect from '@effect/io/Effect'
|
|
4
|
+
|
|
5
|
+
export const matchInterruptCause: {
|
|
6
|
+
<E, A, R2, E2, B, R3, E3, C, R4, E4, D>(
|
|
7
|
+
onCause: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>,
|
|
8
|
+
onInterrupt: () => Effect.Effect<R3, E3, C>,
|
|
9
|
+
onSuccess: (a: A) => Effect.Effect<R4, E4, D>,
|
|
10
|
+
): <R>(effect: Effect.Effect<R, E, A>) => Effect.Effect<R | R2 | R3 | R4, E2 | E3 | E4, B | C | D>
|
|
11
|
+
<R, E, A, R2, E2, B, R3, E3, C, R4, E4, D>(
|
|
12
|
+
effect: Effect.Effect<R, E, A>,
|
|
13
|
+
onCause: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>,
|
|
14
|
+
onInterrupt: () => Effect.Effect<R3, E3, C>,
|
|
15
|
+
onSuccess: (a: A) => Effect.Effect<R4, E4, D>,
|
|
16
|
+
): Effect.Effect<R | R2 | R3 | R4, E2 | E3 | E4, B | C | D>
|
|
17
|
+
} = dualWithTrace(
|
|
18
|
+
4,
|
|
19
|
+
(trace) =>
|
|
20
|
+
<R, E, A, R2, E2, B, R3, E3, C, R4, E4, D>(
|
|
21
|
+
effect: Effect.Effect<R, E, A>,
|
|
22
|
+
onCause: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>,
|
|
23
|
+
onInterrupt: () => Effect.Effect<R3, E3, C>,
|
|
24
|
+
onSuccess: (a: A) => Effect.Effect<R4, E4, D>,
|
|
25
|
+
): Effect.Effect<R | R2 | R3 | R4, E2 | E3 | E4, B | C | D> =>
|
|
26
|
+
Effect.matchCauseEffect(effect, splitInterrupt(onCause, onInterrupt), onSuccess).traced(
|
|
27
|
+
trace,
|
|
28
|
+
),
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
export const splitInterrupt: {
|
|
32
|
+
<E, R2, E2, B, R3, E3, C>(
|
|
33
|
+
onCause: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>,
|
|
34
|
+
onInterrupt: () => Effect.Effect<R3, E3, C>,
|
|
35
|
+
): (cause: Cause.Cause<E>) => Effect.Effect<R2 | R3, E2 | E3, B | C>
|
|
36
|
+
<E, R2, E2, B, R3, E3, C>(
|
|
37
|
+
cause: Cause.Cause<E>,
|
|
38
|
+
onCause: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>,
|
|
39
|
+
onInterrupt: () => Effect.Effect<R3, E3, C>,
|
|
40
|
+
): Effect.Effect<R2 | R3, E2 | E3, B | C>
|
|
41
|
+
} = dualWithTrace(
|
|
42
|
+
3,
|
|
43
|
+
(trace) =>
|
|
44
|
+
<E, R2, E2, B, R3, E3, C>(
|
|
45
|
+
cause: Cause.Cause<E>,
|
|
46
|
+
onCause: (cause: Cause.Cause<E>) => Effect.Effect<R2, E2, B>,
|
|
47
|
+
onInterrupt: () => Effect.Effect<R3, E3, C>,
|
|
48
|
+
): Effect.Effect<R2 | R3, E2 | E3, B | C> =>
|
|
49
|
+
(Cause.isInterruptedOnly(cause) ? onInterrupt() : onCause(cause)).traced(trace),
|
|
50
|
+
)
|
package/src/operator/combine.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as Effect from '@effect/io/Effect'
|
|
|
3
3
|
|
|
4
4
|
import { Fx } from '../Fx.js'
|
|
5
5
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
6
|
+
import { splitInterrupt } from '../_internal/matchInterruptCause.js'
|
|
6
7
|
|
|
7
8
|
export function combineAll<Streams extends readonly Fx<any, any, any>[]>(
|
|
8
9
|
...streams: Streams
|
|
@@ -75,7 +76,7 @@ class CombineAllFx<Streams extends readonly Fx<any, any, any>[]>
|
|
|
75
76
|
Effect.sync(() => results.set(i, a)),
|
|
76
77
|
Effect.zipRight(emitIfReady),
|
|
77
78
|
),
|
|
78
|
-
sink.error,
|
|
79
|
+
splitInterrupt(sink.error, () => counter.decrement),
|
|
79
80
|
counter.decrement,
|
|
80
81
|
),
|
|
81
82
|
),
|
package/src/operator/debounce.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as Duration from '@effect/data/Duration'
|
|
2
2
|
import { pipe } from '@effect/data/Function'
|
|
3
|
-
import * as Cause from '@effect/io/Cause'
|
|
4
3
|
import * as Effect from '@effect/io/Effect'
|
|
5
4
|
import * as Fiber from '@effect/io/Fiber'
|
|
6
5
|
|
|
7
6
|
import { Fx } from '../Fx.js'
|
|
8
7
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
8
|
+
import { matchInterruptCause } from '../_internal/matchInterruptCause.js'
|
|
9
9
|
|
|
10
10
|
export function debounce(duration: Duration.Duration) {
|
|
11
11
|
return <R, E, A>(fx: Fx<R, E, A>): Fx<R, E, A> => new DebounceFx(fx, duration)
|
|
@@ -36,11 +36,12 @@ class DebounceFx<R, E, A> extends Fx.Variance<R, E, A> implements Fx<R, E, A> {
|
|
|
36
36
|
sink.event(a),
|
|
37
37
|
Effect.delay(duration),
|
|
38
38
|
Effect.interruptible,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
matchInterruptCause(
|
|
40
|
+
sink.error,
|
|
41
|
+
() => counter.decrement,
|
|
42
|
+
() => counter.decrement,
|
|
43
43
|
),
|
|
44
|
+
Effect.uninterruptible,
|
|
44
45
|
Effect.forkScoped,
|
|
45
46
|
Effect.tap((fiber) =>
|
|
46
47
|
Effect.sync(() => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { dual, pipe } from '@effect/data/Function'
|
|
2
2
|
import type { FlatMap } from '@effect/data/typeclass/FlatMap'
|
|
3
|
-
import * as Cause from '@effect/io/Cause'
|
|
4
3
|
import * as Effect from '@effect/io/Effect'
|
|
5
4
|
import type * as Fiber from '@effect/io/Fiber'
|
|
6
5
|
import * as Ref from '@effect/io/Ref/Synchronized'
|
|
7
6
|
|
|
8
7
|
import { Fx } from '../Fx.js'
|
|
9
8
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
9
|
+
import { splitInterrupt } from '../_internal/matchInterruptCause.js'
|
|
10
10
|
import type { FxTypeLambda } from '../typeclass/TypeLambda.js'
|
|
11
11
|
|
|
12
12
|
export const exhaustMap: FlatMap<FxTypeLambda>['flatMap'] = dual(
|
|
@@ -51,10 +51,8 @@ class ExhaustMapFx<R, E, A, R2, E2, B>
|
|
|
51
51
|
pipe(resetRef, Effect.zipRight(counter.decrement)),
|
|
52
52
|
),
|
|
53
53
|
),
|
|
54
|
-
Effect.
|
|
55
|
-
|
|
56
|
-
? Effect.unit()
|
|
57
|
-
: sink.error(cause),
|
|
54
|
+
Effect.catchAllCause(
|
|
55
|
+
splitInterrupt(sink.error, () => counter.decrement),
|
|
58
56
|
),
|
|
59
57
|
),
|
|
60
58
|
),
|
package/src/operator/flatMap.ts
CHANGED
|
@@ -35,7 +35,7 @@ class FlatMapFx<R, E, A, R2, E2, B>
|
|
|
35
35
|
Effect.flatMap(() =>
|
|
36
36
|
this.f(a).run(Fx.Sink(sink.event, sink.error, counter.decrement)),
|
|
37
37
|
),
|
|
38
|
-
Effect.
|
|
38
|
+
Effect.catchAllCause((cause) =>
|
|
39
39
|
Cause.isInterruptedOnly(cause) ? Effect.unit() : sink.error(cause),
|
|
40
40
|
),
|
|
41
41
|
Effect.forkScoped,
|
|
@@ -32,7 +32,7 @@ class FlatMapCauseFx<R, E, A, R2, E2, B>
|
|
|
32
32
|
Effect.flatMap(() =>
|
|
33
33
|
this.f(cause).run(Fx.Sink(sink.event, sink.error, counter.decrement)),
|
|
34
34
|
),
|
|
35
|
-
Effect.
|
|
35
|
+
Effect.catchAllCause((cause) =>
|
|
36
36
|
Cause.isInterruptedOnly(cause) ? Effect.unit() : sink.error(cause),
|
|
37
37
|
),
|
|
38
38
|
Effect.forkScoped,
|
|
@@ -20,7 +20,7 @@ export function mergeRace<R2, E2, B>(raced: Fx<R2, E2, B>) {
|
|
|
20
20
|
const racedFiber = yield* $(
|
|
21
21
|
pipe(
|
|
22
22
|
raced.run(Fx.Sink(sink.event, sink.error, Effect.unit())),
|
|
23
|
-
Effect.
|
|
23
|
+
Effect.catchAllCause((cause) =>
|
|
24
24
|
Cause.isInterruptedOnly(cause) ? Effect.unit() : sink.error(cause),
|
|
25
25
|
),
|
|
26
26
|
Effect.forkScoped,
|
package/src/operator/snapshot.ts
CHANGED
|
@@ -33,7 +33,7 @@ class SnapshotFx<R, E, A, R2, E2, B, C>
|
|
|
33
33
|
pipe(
|
|
34
34
|
sampled,
|
|
35
35
|
run((b) => pipe(ref, Ref.set(Option.some(b))), sink.error, Effect.unit()),
|
|
36
|
-
Effect.
|
|
36
|
+
Effect.catchAllCause((cause) =>
|
|
37
37
|
Cause.isInterruptedOnly(cause) ? Effect.unit() : sink.error(cause),
|
|
38
38
|
),
|
|
39
39
|
Effect.forkScoped,
|
|
@@ -37,7 +37,7 @@ class SnapshotEffectFx<R, E, A, R2, E2, B, R3, E3, C>
|
|
|
37
37
|
pipe(
|
|
38
38
|
sampled,
|
|
39
39
|
run((b) => pipe(ref, Ref.set(Option.some(b))), sink.error, Effect.unit()),
|
|
40
|
-
Effect.
|
|
40
|
+
Effect.catchAllCause((cause) =>
|
|
41
41
|
Cause.isInterruptedOnly(cause) ? Effect.unit() : sink.error(cause),
|
|
42
42
|
),
|
|
43
43
|
Effect.forkScoped,
|
|
@@ -7,6 +7,7 @@ import * as Ref from '@effect/io/Ref/Synchronized'
|
|
|
7
7
|
|
|
8
8
|
import { Fx } from '../Fx.js'
|
|
9
9
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
10
|
+
import { splitInterrupt } from '../_internal/matchInterruptCause.js'
|
|
10
11
|
import type { FxTypeLambda } from '../typeclass/TypeLambda.js'
|
|
11
12
|
|
|
12
13
|
export const switchMap: FlatMap<FxTypeLambda>['flatMap'] = dual(
|
|
@@ -64,6 +65,11 @@ class SwitchMapFx<R, E, A, R2, E2, B>
|
|
|
64
65
|
pipe(counter.decrement, Effect.zipLeft(resetRef)),
|
|
65
66
|
),
|
|
66
67
|
),
|
|
68
|
+
Effect.catchAllCause(
|
|
69
|
+
splitInterrupt(sink.error, () =>
|
|
70
|
+
pipe(resetRef, Effect.zipRight(counter.decrement)),
|
|
71
|
+
),
|
|
72
|
+
),
|
|
67
73
|
Effect.forkScoped,
|
|
68
74
|
),
|
|
69
75
|
),
|
|
@@ -75,6 +81,7 @@ class SwitchMapFx<R, E, A, R2, E2, B>
|
|
|
75
81
|
),
|
|
76
82
|
)
|
|
77
83
|
}),
|
|
84
|
+
Effect.catchAllCause(splitInterrupt(sink.error, () => counter.decrement)),
|
|
78
85
|
),
|
|
79
86
|
sink.end,
|
|
80
87
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { pipe } from '@effect/data/Function'
|
|
2
2
|
import * as Cause from '@effect/io/Cause'
|
|
3
3
|
import * as Effect from '@effect/io/Effect'
|
|
4
4
|
import * as Fiber from '@effect/io/Fiber'
|
|
@@ -6,6 +6,7 @@ import * as Ref from '@effect/io/Ref/Synchronized'
|
|
|
6
6
|
|
|
7
7
|
import { Fx } from '../Fx.js'
|
|
8
8
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
9
|
+
import { splitInterrupt } from '../_internal/matchInterruptCause.js'
|
|
9
10
|
|
|
10
11
|
import { catchTag_ } from './catchTag.js'
|
|
11
12
|
|
|
@@ -65,14 +66,7 @@ class SwitchMapCauseFx<R, E, A, R2, E2, B>
|
|
|
65
66
|
this.f(cause).run(
|
|
66
67
|
Fx.Sink(
|
|
67
68
|
sink.event,
|
|
68
|
-
|
|
69
|
-
Effect.unified((cause) =>
|
|
70
|
-
Cause.isInterruptedOnly(cause)
|
|
71
|
-
? counter.decrement
|
|
72
|
-
: sink.error(cause),
|
|
73
|
-
),
|
|
74
|
-
Effect.zipLeft(resetRef),
|
|
75
|
-
),
|
|
69
|
+
splitInterrupt(sink.error, () => counter.decrement),
|
|
76
70
|
pipe(counter.decrement, Effect.zipLeft(resetRef)),
|
|
77
71
|
),
|
|
78
72
|
),
|
|
@@ -7,6 +7,7 @@ import * as Ref from '@effect/io/Ref/Synchronized'
|
|
|
7
7
|
|
|
8
8
|
import { Fx } from '../Fx.js'
|
|
9
9
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
10
|
+
import { splitInterrupt } from '../_internal/matchInterruptCause.js'
|
|
10
11
|
import { failCause } from '../constructor/failCause.js'
|
|
11
12
|
|
|
12
13
|
export function switchMatchCause<E, R2, E2, B, A, R3, E3, C>(
|
|
@@ -67,18 +68,13 @@ class SwitchMatchFx<R, E, A, R2, E2, B, R3, E3, C>
|
|
|
67
68
|
fx.run(
|
|
68
69
|
Fx.Sink(
|
|
69
70
|
sink.event,
|
|
70
|
-
|
|
71
|
-
Effect.
|
|
72
|
-
Cause.isInterruptedOnly(cause)
|
|
73
|
-
? counter.decrement
|
|
74
|
-
: sink.error(cause),
|
|
75
|
-
),
|
|
76
|
-
Effect.zipLeft(resetRef),
|
|
71
|
+
splitInterrupt(sink.error, () =>
|
|
72
|
+
Effect.zip(counter.decrement, resetRef),
|
|
77
73
|
),
|
|
78
74
|
pipe(counter.decrement, Effect.zipLeft(resetRef)),
|
|
79
75
|
),
|
|
80
76
|
),
|
|
81
|
-
Effect.
|
|
77
|
+
Effect.catchAllCause((cause) =>
|
|
82
78
|
Cause.isInterruptedOnly(cause) ? Effect.unit() : sink.error(cause),
|
|
83
79
|
),
|
|
84
80
|
Effect.forkScoped,
|
package/src/operator/zip.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as Effect from '@effect/io/Effect'
|
|
|
3
3
|
|
|
4
4
|
import { Fx } from '../Fx.js'
|
|
5
5
|
import { withRefCounter } from '../_internal/RefCounter.js'
|
|
6
|
+
import { splitInterrupt } from '../_internal/matchInterruptCause.js'
|
|
6
7
|
|
|
7
8
|
export function zipAll<Streams extends readonly Fx<any, any, any>[]>(
|
|
8
9
|
...streams: Streams
|
|
@@ -79,7 +80,7 @@ class ZipAllFx<Streams extends readonly Fx<any, any, any>[]>
|
|
|
79
80
|
Effect.sync(() => results.set(i, a)),
|
|
80
81
|
Effect.zipRight(emitIfReady),
|
|
81
82
|
),
|
|
82
|
-
sink.error,
|
|
83
|
+
splitInterrupt(sink.error, () => counter.decrement),
|
|
83
84
|
counter.decrement,
|
|
84
85
|
),
|
|
85
86
|
),
|
package/src/run/run.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as Fiber from '@effect/io/Fiber'
|
|
|
6
6
|
import type { Scope } from '@effect/io/Scope'
|
|
7
7
|
|
|
8
8
|
import { Fx, Sink } from '../Fx.js'
|
|
9
|
+
import { matchInterruptCause } from '../_internal/matchInterruptCause.js'
|
|
9
10
|
|
|
10
11
|
export function run<A, R2, E2, E, R3, E3, B, R4, E4>(
|
|
11
12
|
event: (a: A) => Effect.Effect<R2, E2, any>,
|
|
@@ -26,11 +27,12 @@ export function run_<A, R2, E2, E, R3, E3, B, R4, E4>(
|
|
|
26
27
|
const sink = Sink(
|
|
27
28
|
flow(
|
|
28
29
|
event,
|
|
29
|
-
|
|
30
|
+
matchInterruptCause(
|
|
30
31
|
(cause) =>
|
|
31
32
|
Effect.sync(() =>
|
|
32
33
|
Deferred.unsafeDone<E2 | E3 | E4, B>(deferred, Effect.failCause(cause)),
|
|
33
34
|
),
|
|
35
|
+
() => pipe(end, Effect.intoDeferred(deferred)),
|
|
34
36
|
Effect.unit,
|
|
35
37
|
),
|
|
36
38
|
),
|
|
@@ -41,7 +43,7 @@ export function run_<A, R2, E2, E, R3, E3, B, R4, E4>(
|
|
|
41
43
|
const fiber = yield* $(
|
|
42
44
|
pipe(
|
|
43
45
|
fx.run(sink),
|
|
44
|
-
Effect.
|
|
46
|
+
Effect.catchAllCause((cause) =>
|
|
45
47
|
Effect.sync(() =>
|
|
46
48
|
Cause.isInterruptedOnly(cause)
|
|
47
49
|
? null
|