I am using redux sagas event channel. I have a specific use case where i want to getStore state when event gets triggered as eventChannel is not generator function i am not able to use select effect of redux sagas. Any other way to achieve this ?
I had also tried to import store and use store.getState()
but i am getting undefined as saga file is imported before store gets initialized.
function subscribe(socket) {
return eventChannel(emit => {
socket.subscribe(listenerTopic, {qos: 1});
socket.on('reconnection', () => {
// i need to fetch latest unread message, for that i need to get timestamp
// for last message received which is in store so the command will be to
// send sinceDate i.e last message timestamp and untilDate that is currentDate
})
}