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

Function makeSnapshot

packages/effect/src/ui/Query.ts:3444–3463  ·  view source on GitHub ↗
(
  def: QueryDef,
  label: string,
  entry: { readonly args: unknown; readonly argsKey: string } | undefined,
  result: Settled | undefined,
  patched = false,
  more?: More<any> | undefined
)

Source from the content-addressed store, hash-verified

3442
3443/** @internal */
3444export const makeSnapshot = (
3445 def: QueryDef,
3446 label: string,
3447 entry: { readonly args: unknown; readonly argsKey: string } | undefined,
3448 result: Settled | undefined,
3449 patched = false,
3450 more?: More<any> | undefined
3451): SnapshotImpl =>
3452 new SnapshotImpl({
3453 def,
3454 label,
3455 argsKey: entry?.argsKey,
3456 // As the key sees them, so the args Schema never meets an `undefined` the key dropped.
3457 args: entry === undefined ? undefined : def.normalize(entry.args),
3458 result: entry === undefined ? undefined : result,
3459 patched: entry !== undefined && patched && result?._tag === "Success",
3460 more: def.list === undefined || entry === undefined || result === undefined
3461 ? undefined
3462 : more ?? moreEnd
3463 })
3464
3465/** @internal */
3466export const snapshotData = (u: unknown): SnapshotData | undefined =>

Callers 1

snapshotWireFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected