| 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) { |