@reffuse/extension-query 0.1.4 #15

Merged
Thilawyn merged 340 commits from next into master 2025-05-26 04:15:01 +02:00
Showing only changes of commit f85173fa68 - Show all commits

View File

@@ -58,9 +58,12 @@ export const make = <EH, K extends readonly unknown[], A, E, HandledE, R>(
const forkMutate = (...key: K) => Queue.unbounded<AsyncData.AsyncData<A, Exclude<E, HandledE>>>().pipe(
Effect.flatMap(stateQueue =>
run(key, value => Queue.offer(stateQueue, value).pipe(
Effect.andThen(Ref.set(stateRef, value))
)).pipe(
run(
key,
value => Ref.set(stateRef, value).pipe(
Effect.andThen(Queue.offer(stateQueue, value))
),
).pipe(
Effect.tap(() => Queue.shutdown(stateQueue)),
Effect.forkDaemon,
Effect.map(fiber => [fiber, Stream.fromQueue(stateQueue)] as const)