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

Method publish

packages/effect/src/PubSub.ts:2082–2097  ·  view source on GitHub ↗
(value: A)

Source from the content-addressed store, hash-verified

2080 }
2081
2082 publish(value: A): boolean {
2083 const replayIndex = this.replayBuffer?.offer(value)
2084 const subscribers = this.publisherTail.subscribers
2085 if (subscribers !== 0) {
2086 const node: Node<A> = {
2087 value,
2088 replayIndex,
2089 subscribers,
2090 next: null
2091 }
2092 this.publisherTail.next = node
2093 this.publisherTail = this.publisherTail.next
2094 this.publisherIndex += 1
2095 }
2096 return true
2097 }
2098
2099 publishAll(elements: Iterable<A>): Array<A> {
2100 if (this.publisherTail.subscribers !== 0) {

Callers 1

publishAllMethod · 0.95

Calls 1

offerMethod · 0.80

Tested by

no test coverage detected