event-source-plus

A more configurable EventSource implementation that works in browsers, node, and workers

MIT License

Downloads
6.8K
Stars
38
event-source-plus - v0.1.7

Published by joshmossas 12 days ago

What's Changed

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

event-source-plus - v0.1.6

Published by joshmossas 19 days ago

event-source-plus - v0.1.5

Published by joshmossas 19 days ago

What's Changed

Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.4...v0.1.5

event-source-plus - v0.1.4

Published by joshmossas about 1 month ago

What's Changed

  • Upgrade ofetch to v1.4.0
  • Upgrade dev dependencies to latest

Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.3...v0.1.4

event-source-plus - v0.1.3 Latest Release

Published by joshmossas 3 months ago

What's Changed

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

event-source-plus - v0.1.2

Published by joshmossas 3 months ago

What's Changed

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

event-source-plus - v0.1.1

Published by joshmossas 5 months ago

What's Changed

Full Changelog: https://github.com/joshmossas/event-source-plus/compare/v0.1.0...v0.1.1

event-source-plus - v0.1.0

Published by joshmossas 5 months ago

What's Changed

Aync header function support

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.

Minor Version Bump

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.