@billionkeys/react-native-eventsource
v1.1.0
Published
React-Native component for EventSource: Server-Sent Events for iOS and Android
Downloads
3
Readme
react-native-eventsource
Description
A react-native component for EventSource: Server-Sent Events for iOS and Android.
Install
yarn add @billionkeys/react-native-eventsource
How to use it?
import EventSource from "@billionkeys/react-native-eventsource";
const url = "https://domain/sse";
const eventSource = new EventSource(url);
eventSource.onopen = () => {
console.debug("onopen");
};
eventSource.onmessage = message => {
console.debug(message);
};
eventSource.onerror = err => {
console.error(err);
};
License
MIT © billionkeys