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

Function makeStreamPull

packages/effect/src/unstable/reactivity/Atom.ts:1350–1356  ·  view source on GitHub ↗
(
  pullSignal: Writable<number>,
  pullAtom: Atom<PullResult<A, E>>
)

Source from the content-addressed store, hash-verified

1348 )
1349
1350const makeStreamPull = <A, E>(
1351 pullSignal: Writable<number>,
1352 pullAtom: Atom<PullResult<A, E>>
1353) =>
1354 writable(pullAtom.read, function(ctx, _) {
1355 ctx.set(pullSignal, ctx.get(pullSignal) + 1)
1356 })
1357
1358/**
1359 * Creates a memoized atom factory that returns the same object for the same argument, using weak references for cached values when the platform supports them.

Callers 1

pullFunction · 0.85

Calls 2

setMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected