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

Function stream

packages/effect/src/unstable/reactivity/AtomRegistry.ts:989–1000  ·  view source on GitHub ↗
(this: Lifetime<any>, atom: Atom.Atom<A>, options?: {
    readonly withoutInitialValue?: boolean
  })

Source from the content-addressed store, hash-verified

987 },
988
989 stream<A>(this: Lifetime<any>, atom: Atom.Atom<A>, options?: {
990 readonly withoutInitialValue?: boolean
991 }) {
992 if (this.disposed) return Stream.empty
993 return Stream.callback<A>((queue) =>
994 Effect.sync(() => {
995 this.subscribe(atom, (value) => Queue.offerUnsafe(queue, value), {
996 immediate: !options?.withoutInitialValue
997 })
998 })
999 )
1000 },
1001
1002 streamResult<A, E>(this: Lifetime<any>, atom: Atom.Atom<Result.AsyncResult<A, E>>, options?: {
1003 readonly withoutInitialValue?: boolean

Callers

nothing calls this directly

Calls 3

offerUnsafeMethod · 0.80
subscribeMethod · 0.65
syncMethod · 0.45

Tested by

no test coverage detected