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

Function pull

packages/effect/src/unstable/reactivity/Atom.ts:1265–1276  ·  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

1263 * @since 4.0.0
1264 */
1265export const pull = <A, E>(
1266 create: ((get: AtomContext) => Stream.Stream<A, E, AtomRegistry>) | Stream.Stream<A, E, AtomRegistry>,
1267 options?: {
1268 readonly disableAccumulation?: boolean | undefined
1269 }
1270): Writable<PullResult<A, E>, void> => {
1271 const pullSignal = removeTtl(state(0))
1272 const pullAtom = readable(makeRead(function(get) {
1273 return makeStreamPullEffect(get, pullSignal, create, options)
1274 }))
1275 return makeStreamPull(pullSignal, pullAtom)
1276}
1277
1278const makeStreamPullEffect = <A, E>(
1279 get: AtomContext,

Callers

nothing calls this directly

Calls 2

makeStreamPullEffectFunction · 0.85
makeStreamPullFunction · 0.85

Tested by

no test coverage detected