0.1.11 #14
@@ -1,4 +1,4 @@
|
|||||||
import { Array, type Context, Effect, ExecutionStrategy, Exit, type Fiber, type Layer, Option, pipe, Pipeable, Queue, Ref, Runtime, Scope, Stream, SubscriptionRef } from "effect"
|
import { type Context, Effect, ExecutionStrategy, Exit, type Fiber, type Layer, Option, pipe, Pipeable, Queue, Ref, Runtime, Scope, Stream, SubscriptionRef } from "effect"
|
||||||
import * as React from "react"
|
import * as React from "react"
|
||||||
import * as ReffuseContext from "./ReffuseContext.js"
|
import * as ReffuseContext from "./ReffuseContext.js"
|
||||||
import * as ReffuseRuntime from "./ReffuseRuntime.js"
|
import * as ReffuseRuntime from "./ReffuseRuntime.js"
|
||||||
@@ -397,8 +397,8 @@ export abstract class ReffuseNamespace<R> {
|
|||||||
{ doNotReExecuteOnRuntimeOrContextChange: true },
|
{ doNotReExecuteOnRuntimeOrContextChange: true },
|
||||||
) as [...{ [K in keyof Refs]: Effect.Effect.Success<Refs[K]> }])
|
) as [...{ [K in keyof Refs]: Effect.Effect.Success<Refs[K]> }])
|
||||||
|
|
||||||
this.useFork(() => pipe(refs as readonly SubscriptionRef.SubscriptionRef<any>[],
|
this.useFork(() => pipe(
|
||||||
Array.map(ref => Stream.changesWith(ref.changes, (x, y) => x === y)),
|
refs.map(ref => Stream.changesWith(ref.changes, (x, y) => x === y)),
|
||||||
streams => Stream.zipLatestAll(...streams),
|
streams => Stream.zipLatestAll(...streams),
|
||||||
Stream.runForEach(v =>
|
Stream.runForEach(v =>
|
||||||
Effect.sync(() => setReactStateValue(v as [...{ [K in keyof Refs]: Effect.Effect.Success<Refs[K]> }]))
|
Effect.sync(() => setReactStateValue(v as [...{ [K in keyof Refs]: Effect.Effect.Success<Refs[K]> }]))
|
||||||
|
|||||||
Reference in New Issue
Block a user