(elements: Iterable<A>)
| 1939 | } |
| 1940 | |
| 1941 | publishAll(elements: Iterable<A>): Array<A> { |
| 1942 | if (this.subscriberCount === 0) { |
| 1943 | if (this.replayBuffer) { |
| 1944 | this.replayBuffer.offerAll(elements) |
| 1945 | } |
| 1946 | return [] |
| 1947 | } |
| 1948 | const chunk = Arr.fromIterable(elements) |
| 1949 | if (chunk.length === 0) { |
| 1950 | return chunk |
| 1951 | } |
| 1952 | if (this.publish(chunk[0])) { |
| 1953 | return chunk.slice(1) |
| 1954 | } else { |
| 1955 | return chunk |
| 1956 | } |
| 1957 | } |
| 1958 | |
| 1959 | slide(): void { |
| 1960 | if (this.isFull()) { |