MCPcopy Index your code
hub / github.com/Effect-TS/effect / subscriber

Function subscriber

packages/effect/test/SubscriptionRef.test.ts:66–76  ·  view source on GitHub ↗
(subscriptionRef: SubscriptionRef.SubscriptionRef<number>)

Source from the content-addressed store, hash-verified

64 it.effect("concurrent subscribes and unsubscribes are handled correctly", () =>
65 Effect.gen(function*() {
66 const subscriber = (subscriptionRef: SubscriptionRef.SubscriptionRef<number>) =>
67 pipe(
68 Random.nextIntBetween(0, 200),
69 Effect.flatMap((n) =>
70 pipe(
71 subscriptionRef.changes,
72 Stream.take(n),
73 Stream.runCollect
74 )
75 )
76 )
77 const subscriptionRef = yield* (SubscriptionRef.make(0))
78 const fiber = yield* pipe(
79 SubscriptionRef.update(subscriptionRef, (n) => n + 1),

Callers 1

Calls 3

pipeFunction · 0.90
nextIntBetweenMethod · 0.65
takeMethod · 0.65

Tested by

no test coverage detected