Skip to content

Commit 964c321

Browse files
author
Datner
committed
fix: change to the correct type
Effect --> Stream
1 parent 19d8a70 commit 964c321

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/hooks/useResult.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import type { ResultBag } from "effect-react/hooks/useResultBag"
66
import { updateNext, useResultBag } from "effect-react/hooks/useResultBag"
77
import type { RuntimeContext } from "effect-react/internal/runtimeContext"
88
import * as Result from "effect-react/Result"
9-
import { useContext, useRef, useState } from "react"
9+
import { useContext, useEffect, useRef, useState } from "react"
1010

1111
export 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

1515
export 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
}

0 commit comments

Comments
 (0)