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

Function handle

packages/vue/src/mutate.ts:356–385  ·  view source on GitHub ↗
(eff: Effect.Effect<A, E, R>, input?: unknown)

Source from the content-addressed store, hash-verified

354 ),
355 Effect.forkDetach({ startImmediately: true })
356 )
357 }
358 if (awaitKeys.length > 0) {
359 yield* queryInvalidator.invalidateAndAwait(awaitKeys)
360 }
361 })
362 )
363 .pipe(
364 Effect.tap(Effect.sleep(0.1)), // allow for refs to update etc
365 Effect.withSpan("client.query.invalidation", {}, { captureStackTrace: false })
366 )
367 })
368
369 return invalidateCache
370}
371
372export const invalidateQueries = <RInvalidator>(
373 self: { id: string; options?: ClientForOptions; disableQueryInvalidation?: boolean },
374 options: MutationOptionsBase | undefined,
375 queryInvalidator: QueryInvalidator<RInvalidator>
376) => {
377 const invalidateCache = buildInvalidateCache(self, options?.queryInvalidation, queryInvalidator)
378
379 const select = options?.select
380
381 const handle = <A, E, R>(eff: Effect.Effect<A, E, R>, input?: unknown) =>
382 Effect.gen(function*() {
383 const keysRef = yield* Ref.make<ReadonlyArray<InvalidationKey>>([])
384 const readsRef = yield* Ref.make(DataDependencies.empty())
385 const writesRef = yield* Ref.make(DataDependencies.empty())
386 const dependencyRecorder = DataDependencies.makeDataDependencyRecorder(readsRef, writesRef)
387 const result = yield* eff.pipe(
388 Effect.provideService(InvalidationKeysFromServer, makeInvalidationKeysService(keysRef)),

Callers

nothing calls this directly

Calls 6

invalidateCacheFunction · 0.85
makeMethod · 0.65
pipeMethod · 0.65
getMethod · 0.65
selectFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…