Skip to content

Instantly share code, notes, and snippets.

@tlaitinen
Last active August 21, 2019 14:28
Show Gist options
  • Save tlaitinen/5b46cb63b89883ccce805c5e2dc6cb59 to your computer and use it in GitHub Desktop.
Save tlaitinen/5b46cb63b89883ccce805c5e2dc6cb59 to your computer and use it in GitHub Desktop.
const {actionChannel} = require('redux-saga/effects');
// const {buffers} = require('redux-saga');
const {createStore, applyMiddleware} = require('redux');
const reduxSaga = require('redux-saga');
const sagaMiddleware = reduxSaga.default();
const store = createStore((state={}) => state, applyMiddleware(sagaMiddleware));
sagaMiddleware.run(function* () {
const channel = yield actionChannel('TEST'/*, buffers.expanding()*/);
});
for (let i = 0; i < 11; i++) {
store.dispatch({type:'TEST'})
}
/*
/home/tero/test/node_modules/redux-saga/lib/internal/buffers.js:61
throw new Error(BUFFER_OVERFLOW);
^
Error: Channel's Buffer overflow!
at Object.put (/home/tero/test/node_modules/redux-saga/lib/internal/buffers.js:61:19)
at Object.put (/home/tero/test/node_modules/redux-saga/lib/internal/channel.js:79:21)
at Array.<anonymous> (/home/tero/test/node_modules/redux-saga/lib/internal/channel.js:173:10)
at Object.emit (/home/tero/test/node_modules/redux-saga/lib/internal/channel.js:38:13)
at Object.dispatch (/home/tero/test/node_modules/redux-saga/lib/internal/middleware.js:73:21)
at Object.<anonymous> (/home/tero/test/test.js:15:9)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment