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

Function pull

packages/effect/src/reactivity/Atom.ts:1339–1350  ·  view source on GitHub ↗
(
  create: ((get: AtomContext) => Stream.Stream<A, E, AtomRegistry>) | Stream.Stream<A, E, AtomRegistry>,
  options?: {
    readonly disableAccumulation?: boolean | undefined
  }
)

Source from the content-addressed store, hash-verified

1337 * @since 4.0.0
1338 */
1339export const pull = <A, E>(
1340 create: ((get: AtomContext) => Stream.Stream<A, E, AtomRegistry>) | Stream.Stream<A, E, AtomRegistry>,
1341 options?: {
1342 readonly disableAccumulation?: boolean | undefined
1343 }
1344): Writable<PullResult<A, E>, void> => {
1345 const pullSignal = removeTtl(state(0))
1346 const pullAtom = readable(makeRead(function(get) {
1347 return makeStreamPullEffect(get, pullSignal, create, options)
1348 }))
1349 return makeStreamPull(pullSignal, pullAtom)
1350}
1351
1352const makeStreamPullEffect = <A, E>(
1353 get: AtomContext,

Callers

nothing calls this directly

Calls 4

readableFunction · 0.85
makeStreamPullEffectFunction · 0.85
makeStreamPullFunction · 0.85
stateFunction · 0.50

Tested by

no test coverage detected