File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import type { ResultBag } from "effect-react/hooks/useResultBag"
6
6
import { updateNext , useResultBag } from "effect-react/hooks/useResultBag"
7
7
import type { RuntimeContext } from "effect-react/internal/runtimeContext"
8
8
import * as Result from "effect-react/Result"
9
- import { useContext , useRef , useState } from "react"
9
+ import { useContext , useEffect , useRef , useState } from "react"
10
10
11
11
export type UseResult < R > = < R0 extends R , E , A > (
12
- effect : Effect . Effect < R0 , E , A >
12
+ stream : Stream . Stream < R0 , E , A >
13
13
) => ResultBag < E , A >
14
14
15
15
export const makeUseResult : < R > (
@@ -45,5 +45,12 @@ export const makeUseResult: <R>(
45
45
46
46
trackRef . current . currentStatus = result . _tag
47
47
48
+ useEffect ( ( ) =>
49
+ ( ) => {
50
+ if ( fiberRef . current ) {
51
+ Effect . runSync ( Fiber . interruptFork ( fiberRef . current ) )
52
+ }
53
+ } , [ ] )
54
+
48
55
return resultBag
49
56
}
You can’t perform that action at this time.
0 commit comments