Closed jmatsushita closed 7 years ago
@jmatsushita
Typically I structure my reducer like the following for different action-to-saga handlers:
import { takeEvery } from 'redux-saga';
import { fork } from 'redux-saga/effects';
function* doSomething() {
// ...
}
function* doOtherThing() {
// ...
}
function* listener() {
yield [
fork(takeEvery, 'SOMETHING', doSomething),
fork(takeEvery, 'OTHERTHING', doOtherThing)
];
}
export default new Updater(initialModel, listener)
.toReducer();
A thing of beauty. Thanks! It should make it's way to the docs :)
This is certainly the right way to do it, however I do not think this should be part of the redux-elm
docs, especially when I am planning to support rxjs
as alternative saga implementation.
Closing, nothing actionable here.
Hi there,
What's the
redux-elm
idiomatic way to route events to different sagas?Right now I do this:
Where doTHINGS branches to
doSOMETHING
anddoOTHERTHING
but I'd like to write something like what case is doing such as:Or a variation on this.
Am I missing something obvious?