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"
66import { updateNext , useResultBag } from "effect-react/hooks/useResultBag"
77import type { RuntimeContext } from "effect-react/internal/runtimeContext"
88import * as Result from "effect-react/Result"
9- import { useContext , useRef , useState } from "react"
9+ import { useContext , useEffect , useRef , useState } from "react"
1010
1111export type UseResult < R > = < R0 extends R , E , A > (
12- effect : Effect . Effect < R0 , E , A >
12+ stream : Stream . Stream < R0 , E , A >
1313) => ResultBag < E , A >
1414
1515export const makeUseResult : < R > (
@@ -45,5 +45,12 @@ export const makeUseResult: <R>(
4545
4646 trackRef . current . currentStatus = result . _tag
4747
48+ useEffect ( ( ) =>
49+ ( ) => {
50+ if ( fiberRef . current ) {
51+ Effect . runSync ( Fiber . interruptFork ( fiberRef . current ) )
52+ }
53+ } , [ ] )
54+
4855 return resultBag
4956 }
You can’t perform that action at this time.
0 commit comments