MCPcopy Create free account
hub / github.com/Effect-TS/effect / applyPatches

Function applyPatches

packages/effect/src/ui/Query.ts:1668–1682  ·  view source on GitHub ↗
(
  patches: ReadonlyArray<Patch>,
  query: R,
  args: Args<R>,
  value: Success<R>
)

Source from the content-addressed store, hash-verified

1666 * @since 4.2.0
1667 */
1668export const applyPatches = <R extends Query.Any>(
1669 patches: ReadonlyArray<Patch>,
1670 query: R,
1671 args: Args<R>,
1672 value: Success<R>
1673): Success<R> => {
1674 const def = defOf(query)
1675 const argsKey = def.argsKey(args)
1676 for (const patch of patches) {
1677 value = applyPatch(patch, def.name, argsKey, args, value) as Success<
1678 R
1679 >
1680 }
1681 return value
1682}
1683
1684/**
1685 * Whether a run with these `invalidates` and `optimistic` declarations

Callers 1

Generator.tsFile · 0.85

Calls 2

defOfFunction · 0.85
applyPatchFunction · 0.85

Tested by

no test coverage detected