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

Function changes

packages/effect/src/TxSubscriptionRef.ts:449–462  ·  view source on GitHub ↗
(
  self: TxSubscriptionRef<A>
)

Source from the content-addressed store, hash-verified

447 * @since 3.10.0
448 */
449export const changes = <A>(
450 self: TxSubscriptionRef<A>
451): Effect.Effect<TxQueue.TxQueue<A>, never, Scope.Scope> =>
452 Effect.acquireRelease(
453 Effect.tx(
454 Effect.gen(function*() {
455 const sub = yield* TxPubSub.acquireSubscriber(self.pubsub)
456 const current = yield* TxRef.get(self.ref)
457 yield* TxQueue.offer(sub, current)
458 return sub
459 })
460 ),
461 (queue) => Effect.tx(TxPubSub.releaseSubscriber(self.pubsub, queue))
462 )
463
464/**
465 * Returns a Stream of all changes to the TxSubscriptionRef, starting with the

Callers 1

changesStreamFunction · 0.70

Calls 2

offerMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected