redux-saga-event-iterator
An easy way of consuming an EventEmitter (e.g. socket.io) in redux-saga
Installation
Install using npm:
$ npm install --save redux-saga-event-iterator
Example
;;; const socketClient = ; const listenerSaga = { const nextEvent removeListener = ; while true const payload = ; // Do something with payload // Optionally remove listener, further calls to nextEvent will throw an error ;};
Testing
To run the tests:
$ npm test
Contributing
Feel free to create a pull request. Make sure to lint and test:
$ npm run lint && npm run test
License
MIT - see LICENSE