feat!: provide onError
, onComment
, and onRetry
callbacks
#15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: The parser now takes an object of callbacks instead of an
onParse
callback. This means you do not have to check the type of the event in theonEvent
callback, but instead provide separate callbacks for each event type.BREAKING CHANGE: The
ParsedEvent
type has been renamed toEventSourceMessage
and thetype
attribute has been removed.BREAKING CHANGE: The
EventSourceCallback
type has been removed in favor of theParserCallbacks
interface.BREAKING CHNAGE: The
ReconnectInterval
type has been removed in favor of providing the interval directly to theonRetry
callback.BREAKING CHANGE: The
ParseEvent
type has been removed in favor of providing separate callbacks for each event type.BREAKING CHANGE: The parser has been rewritten to be more specification compliant. Certain rare edge cases may now be handled differently. Mixed CRLF and LF line endings will now be handled correctly.
retry
fields now have to be completely valid integers to be parsed.