MCPcopy Create free account
hub / github.com/effect-app/libs / makeTanstackQueryInvalidator

Function makeTanstackQueryInvalidator

packages/vue/src/internal/tanstackQuery.ts:102–115  ·  view source on GitHub ↗
(queryClient: QueryClient)

Source from the content-addressed store, hash-verified

100export const makeTanstackQueryClient = () => new QueryClient()
101
102export 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

Callers 4

makeClientFunction · 0.90
makeTanstackHarnessFunction · 0.85

Calls 2

pipeMethod · 0.65
forEachMethod · 0.65

Tested by 1

makeTanstackHarnessFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…