1.1.0 • Published 3 years ago

@billionkeys/react-native-eventsource v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

react-native-eventsource

Dependencies Build License PRs Welcome

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