A more configurable EventSource implementation that works in browsers, node, and workers
MIT License
Published by joshmossas 12 days ago
EventSourcePlusOptions
by @joshmossas in https://github.com/joshmossas/event-source-plus/pull/18
Shout out to @sgerke-1L who noticed a missplaced comment intended for the custom fetch option
Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.6...v0.1.7
Published by joshmossas 19 days ago
Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.5...v0.1.6
Published by joshmossas 19 days ago
Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.4...v0.1.5
Published by joshmossas about 1 month ago
v1.4.0
Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.3...v0.1.4
undefined
by @joshmossas in https://github.com/joshmossas/event-source-plus/pull/13
Prevents a potential infinite loop that occurs when the server returns a 200
status code but the Content-Type
header is not set (thanks to @PattaBov reporting)
Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.2...v0.1.3
Published by joshmossas 3 months ago
\r\n
and \r
line delimiters by @joshmossas in https://github.com/joshmossas/event-source-plus/pull/11
This gets the event-source-plus parser more compliant with the Server Sent Events specification as outlined in https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
Thanks to @teddybee for reporting the issue that led to discovering this bug.
Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.1...v0.1.2
Published by joshmossas 5 months ago
Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.0...v0.1.1
Published by joshmossas 5 months ago
The header function syntax can now return a promise.
new EventSourcePlus("https://example.com", {
headers: async () => {
// this works now
const token = await getSomeToken();
return {
Authorization: token
}
}
})
This should help remove boilerplate in places when your authentication library uses async functions to retrieve session tokens, and jwts.
Version is being bumped to 0.1.0
this will allow for patches and bug fixes without it being treated as a breaking change. We'll stay on 0.1.x
until a breaking change occurs.