http-event-stream
http-event-stream copied to clipboard
Allow passing custom Last-Event-Id
Add an option lastEventId to EventStreamOptions, so the application can pass a custom last event ID.
This is important to have, so that a user can specify a last event ID per query parameter or similar, since the native DOM EventSource does not allow customizing the Last-Event-Id header.
Use case: The user wants to stream data from a certain point onwards (e.g. the last time they were online) when opening the stream. The Last-Event-Id header is only automatically set when reconnecting an already open stream that had some connectivity issue.