Complete the code to start event replay from a specific offset.
eventStream.replayFrom([1])The replay starts from a specific offset in the event stream to ensure correct ordering.
Complete the code to store events for replay in a durable storage.
eventStore.save([1])Events are saved in batches (eventBatch) to durable storage for replay.
Fix the error in the replay function to avoid duplicate event processing.
if (lastProcessedEventId !== [1]) { processEvent(event) }
Comparing with event.id ensures each event is processed once, avoiding duplicates.
Fill both blanks to filter and replay only specific event types.
replayEvents.filter(event => event.[1] === [2])
Filtering by event.type equal to 'UserCreated' replays only those events.
Fill all three blanks to implement a replay with offset, batch size, and event handler.
eventStream.replayFrom([1]).batch([2]).onEvent([3])
The replay starts from offset, processes events in batchSize chunks, and uses handleEvent to process each event.