binaryminds / react-native-sse

Event Source implementation for React Native. Server-Sent Events (SSE) for iOS and Android 🚀
https://www.npmjs.com/package/react-native-sse
MIT License
175 stars 27 forks source link

Cannot read property 'push' of undefined #1

Closed jcoulaud closed 3 years ago

jcoulaud commented 3 years ago

Hey @binaryminds , thank you for your work.

I wanted to give a try to your library, but I may have encountered a problem.

Everything's working as expected, except for custom events.

If I put a custom event like this:

es.addEventListener("topic", event => {
   console.log(">> New event", event);
});

I have the following error when building the app: Cannot read property 'push' of undefined

Any help would be appreciated :)

wojciechkrol commented 3 years ago

Hello @jcoulaud !

We're glad you are using our library! We have found the source of your problem and provided the fix in new release. Update your dependency to version react-native-sse@1.0.5.

Let us know if everything works!

jcoulaud commented 3 years ago

Thank you, everything's working as expected :)