(queryClient: QueryClient)
| 100 | export const makeTanstackQueryClient = () => new QueryClient() |
| 101 | |
| 102 | export const makeTanstackQueryInvalidator = (queryClient: QueryClient): QueryInvalidator => ({ |
| 103 | invalidateAndAwait: (keys) => |
| 104 | Effect |
| 105 | .gen(function*() { |
| 106 | const span = yield* Effect.currentParentSpan.pipe(Effect.orElseSucceed(() => undefined)) |
| 107 | yield* Effect.forEach( |
| 108 | keys, |
| 109 | (queryKey) => { |
| 110 | const options = { updateMeta: { span } } |
| 111 | return Effect.promise(() => queryClient.invalidateQueries({ queryKey }, options)) |
| 112 | }, |
| 113 | { discard: true, concurrency: "unbounded" } |
| 114 | ) |
| 115 | }) |
| 116 | .pipe(Effect.orDie), |
| 117 | invalidateSoft: (keys) => |
| 118 | Effect |
searching dependent graphs…