I am using the sagas reduction event channel. I have a specific use case when I want the getStore state when the event is fired, because eventChannel is not a function of the generator, I cannot use the selected reduction sax effect. Any other way to achieve this?
I also tried to import the repository and use store.getState() , but I get undefined as the saga file is imported before the file is 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 ie last message timestamp and untilDate that is currentDate }) }
redux-saga
Priyank bhatt
source share