From 4f9827720cb3c30877649188f32391edd9d9ea35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sun, 13 Apr 2025 17:18:06 +0200 Subject: [PATCH] Fix --- packages/reffuse/src/ReffuseNamespace.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/reffuse/src/ReffuseNamespace.ts b/packages/reffuse/src/ReffuseNamespace.ts index 5123269..4ed41b7 100644 --- a/packages/reffuse/src/ReffuseNamespace.ts +++ b/packages/reffuse/src/ReffuseNamespace.ts @@ -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 ReffuseContext from "./ReffuseContext.js" import * as ReffuseRuntime from "./ReffuseRuntime.js" @@ -397,8 +397,8 @@ export abstract class ReffuseNamespace { { doNotReExecuteOnRuntimeOrContextChange: true }, ) as [...{ [K in keyof Refs]: Effect.Effect.Success }]) - this.useFork(() => pipe(refs as readonly SubscriptionRef.SubscriptionRef[], - Array.map(ref => Stream.changesWith(ref.changes, (x, y) => x === y)), + this.useFork(() => pipe( + refs.map(ref => Stream.changesWith(ref.changes, (x, y) => x === y)), streams => Stream.zipLatestAll(...streams), Stream.runForEach(v => Effect.sync(() => setReactStateValue(v as [...{ [K in keyof Refs]: Effect.Effect.Success }]))