@@ -1,5 +1,4 @@
|
|||||||
import { Effect, Exit, Fiber, ManagedRuntime, Ref, Stream, SubscriptionRef } from "effect"
|
import { Effect, Exit, Fiber, ManagedRuntime, Ref, Runtime, Stream, SubscriptionRef } from "effect"
|
||||||
import type { RunForkOptions } from "effect/Runtime"
|
|
||||||
import React from "react"
|
import React from "react"
|
||||||
|
|
||||||
|
|
||||||
@@ -49,7 +48,7 @@ export class Reffuse<R, ER> {
|
|||||||
|
|
||||||
runFork<A, E>(
|
runFork<A, E>(
|
||||||
self: Effect.Effect<A, E, R>,
|
self: Effect.Effect<A, E, R>,
|
||||||
options?: RunForkOptions,
|
options?: Runtime.RunForkOptions,
|
||||||
): Fiber.RuntimeFiber<A, ER | E> {
|
): Fiber.RuntimeFiber<A, ER | E> {
|
||||||
return this.useRuntime().runFork(self, options)
|
return this.useRuntime().runFork(self, options)
|
||||||
}
|
}
|
||||||
@@ -58,7 +57,7 @@ export class Reffuse<R, ER> {
|
|||||||
useFork<A, E>(
|
useFork<A, E>(
|
||||||
self: Effect.Effect<A, E, R>,
|
self: Effect.Effect<A, E, R>,
|
||||||
deps?: React.DependencyList,
|
deps?: React.DependencyList,
|
||||||
options?: RunForkOptions,
|
options?: Runtime.RunForkOptions,
|
||||||
): void {
|
): void {
|
||||||
return React.useEffect(() => {
|
return React.useEffect(() => {
|
||||||
const fiber = this.runFork(self.pipe(Effect.scoped), options)
|
const fiber = this.runFork(self.pipe(Effect.scoped), options)
|
||||||
|
|||||||
Reference in New Issue
Block a user