Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Releases: jordanbyron/react-native-event-source

Version 1.1.0

27 May 20:33
Compare
Choose a tag to compare

Update EventSource to support chunked data (#21)

Previously, our copy of EventSource didn't work when a line came which hadn't been terminated with a new line (chunked data). In that case, the split('\n') call would give you junk data which the rest of the logic couldn't handle.

There might be another edge case where the XHR request finishes before the full line comes in but that's outside the scope of this change.

Version 1.0.5

03 May 00:27
Compare
Choose a tag to compare

Options argument is now truly optional, thanks to @davidsharp's work on #19

Version 1.0.4

16 Apr 10:41
Compare
Choose a tag to compare

Allow override of method and body via the options argument (#18)

Version 1.0.3

20 Mar 23:59
Compare
Choose a tag to compare

Make xhr.timeout configurable (#16) via the timeout option.

const options = { timeout: 1000 }; // seconds
const eventSource = new RNEventSource('https://my-sse.com/stream', options);

Version 1.0.2

02 Feb 15:41
Compare
Choose a tag to compare

Bug Fix: Declare missing retry variable (#15)

Version 1.0.1

21 Feb 02:18
Compare
Choose a tag to compare

Adds an optional argument to RNEventSource for passing headers along to EventSource. Handy for authorization.

const options = { headers: { Authorization: 'Baerer ...' } };
const eventSource = new RNEventSource('https://my-sse.com/stream', options);

Thanks to @dflourusso for the pull request!

Version 1.0.0

28 Oct 13:00
Compare
Choose a tag to compare

It's here! 1.0.0!!!! 🙌

This release includes a nice wrapper around interacting with event sources within your RN apps:

const eventSource = new RNEventSource('https://my-sse.com/stream');

eventSource.addEventListener('message', (event) => {
  console.log(event.type); //=> message
  console.log(event.data);
});

We've also moved from a pure Obj-C EventSource implementation to a Javascript implementation. This now allows this library to be used on Andriod RN apps. Hizza!

Version 0.1.0

16 Sep 13:45
Compare
Choose a tag to compare

Upgrade to the latest version of EventSource.

Kill connections on refresh

27 Oct 12:49
Compare
Choose a tag to compare

Prior to this release, refreshing in development mode wouldn't kill connections allowing them to stack up and cause odd behaviors. This release fixes that AND adds better error message support:

DeviceEventEmitter.addListener('EventSourceError', function(error) {
  console.log(error.domain);
  console.log(error.code);
  console.log(error.description);
});

🚒 Enjoy!

Relax react-native dependency

26 Jun 00:50
Compare
Choose a tag to compare

Until 1.0 is released, let's say we support all 0.x.x versions of react-native 👍