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

Function make

packages/effect/src/SubscriptionRef.ts:111–119  ·  view source on GitHub ↗
(value: A)

Source from the content-addressed store, hash-verified

109 * @since 2.0.0
110 */
111export const make = <A>(value: A): Effect.Effect<SubscriptionRef<A>> =>
112 Effect.map(PubSub.unbounded<A>({ replay: 1 }), (pubsub) => {
113 const self = Object.create(Proto)
114 self.semaphore = Semaphore.makeUnsafe(1)
115 self.value = value
116 self.pubsub = pubsub
117 PubSub.publishUnsafe(self.pubsub, value)
118 return self
119 })
120
121/**
122 * Creates a stream that emits the current value and all subsequent changes to

Callers

nothing calls this directly

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected