@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 299109d421 - Show all commits

View File

@@ -30,7 +30,8 @@ export const make = <EH, K extends readonly unknown[], A, E, HandledE, R>(
const mutate = (...key: K) => QueryClient.pipe(
Effect.flatMap(client => client.ErrorHandler),
Effect.flatMap(errorHandler => mutation(...key).pipe(
Effect.flatMap(errorHandler => Ref.set(stateRef, AsyncData.loading()).pipe(
Effect.andThen(mutation(...key)),
errorHandler.handle,
Effect.tapErrorCause(c => Ref.set(stateRef, AsyncData.failure(c))),
Effect.tap(v => Ref.set(stateRef, AsyncData.success(v))),