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
202 stars 30 forks source link

No activity within 45000 milliseconds. #15

Closed jogoool closed 11 months ago

jogoool commented 1 year ago

client disconnect and re-connect after 45 second I'm using redux-saga channel to handle the messages

P V
React Native 0.68.2
Node 14.20
react-native-sse 5.4
const eventSource = yield call(mercureSubscribe, new URL(HUB_URL), [topic])
const channel = yield call(mercureChannel, eventSource)
function mercureChannel(eventSource) {
  return eventChannel((emitter) => {
    eventSource.addEventListener('message', (event) =>
      emitter(JSON.parse(event.data)),
    )
    return () => eventSource.close()
  })
}