Function
replayToStream
(log: EventLog, after: number | "tail")
Source from the content-addressed store, hash-verified
| 504 | } |
| 505 | |
| 506 | function replayToStream(log: EventLog, after: number | "tail"): ReadableStream<ExecEvent> { |
| 507 | const iter = log.replay(after)[Symbol.iterator](); |
| 508 | return new ReadableStream<ExecEvent>({ |
| 509 | pull(controller) { |
| 510 | const next = iter.next(); |
| 511 | if (next.done === true) { |
| 512 | controller.close(); |
| 513 | return; |
| 514 | } |
| 515 | controller.enqueue(next.value); |
| 516 | }, |
| 517 | }); |
| 518 | } |
Tested by
no test coverage detected