()
| 2755 | this.remaining = 0 |
| 2756 | } |
| 2757 | sync(): void { |
| 2758 | const slides = this.buffer.index - this.slideIndex |
| 2759 | if (slides === 0 || this.remaining === 0) { |
| 2760 | return |
| 2761 | } |
| 2762 | const count = Math.min(slides, this.buffer.capacity) |
| 2763 | const start = this.buffer.index - count |
| 2764 | for (let i = 0; i < count; i++) { |
| 2765 | const entry = this.buffer.slideValues[(start + i) % this.buffer.capacity] |
| 2766 | if (entry.index > this.newestIndex) { |
| 2767 | this.index = (this.index + 1) % this.values.length |
| 2768 | this.values[(this.index + this.remaining - 1) % this.values.length] = entry.value |
| 2769 | this.newestIndex = entry.index |
| 2770 | } |
| 2771 | } |
| 2772 | this.slideIndex = this.buffer.index |
| 2773 | } |
| 2774 | take(): A | undefined { |
| 2775 | if (this.remaining === 0) { |
| 2776 | return undefined |
no outgoing calls