()
| 3000 | this.remaining = 0 |
| 3001 | } |
| 3002 | sync(): void { |
| 3003 | const slides = this.buffer.index - this.slideIndex |
| 3004 | if (slides === 0 || this.remaining === 0) { |
| 3005 | return |
| 3006 | } |
| 3007 | const count = Math.min(slides, this.buffer.capacity) |
| 3008 | const start = this.buffer.index - count |
| 3009 | for (let i = 0; i < count; i++) { |
| 3010 | const entry = this.buffer.slideValues[(start + i) % this.buffer.capacity] |
| 3011 | if (entry.index > this.newestIndex) { |
| 3012 | this.index = (this.index + 1) % this.values.length |
| 3013 | this.values[(this.index + this.remaining - 1) % this.values.length] = entry.value |
| 3014 | this.newestIndex = entry.index |
| 3015 | } |
| 3016 | } |
| 3017 | this.slideIndex = this.buffer.index |
| 3018 | } |
| 3019 | take(): A | undefined { |
| 3020 | if (this.remaining === 0) { |
| 3021 | return undefined |
no outgoing calls