combineSagas utility funciton
See original GitHub issueAt the moment we have to do something like
export default function* root() {
yield [
fork(saga1),
fork(saga2),
fork(saga3),
fork(saga4)
];
}
Would be great to have combineSagas just like redux’s combineReducers. Use it like
export default rootSaga = combineSagas({
saga1,
saga2,
...
});
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
The Electric Side of Combination Gas-Electric Utilities - jstor
This paper assesses the effects of combination gas-electric utilities on income redistribution and economic efficiency. It finds that such com-.
Read more >How a Combined Cycle Power Plant Works - TVA
Combined cycle technology allows a power plant to generate 50 percent more electricity from its fuel than it could with a single-cycle power...
Read more >Successful Practices in Combined Gas and Electric Utility ...
and natural gas utilities to operate their own separate programs. ... In contrast, combined natural gas and electric energy efficiency programs can create....
Read more >Combined cycle power plant - Wikipedia
A combined cycle power plant is an assembly of heat engines that work in tandem from the same source of heat, converting it...
Read more >Combined Cycle Power Plant | GE Gas Power
This is how a combined-cycle plant works to produce electricity and captures waste heat from the gas turbine to increase efficiency and electrical...
Read more >Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was more aware of the project structural similarities. I’d have “reduces” folder, contains different reducers, and in index.js it would be something like:
I’ve tried to find a way to sort of “combine” all different sagas into a single rootSaga, so that it can be passed into createSagaMiddleware. Couldn’t find it on docs, but in examples it had a pattern. And the “sagas” folder is very similar to “reducers” - having different sagas, and an index.js that exports rootSaga.
Just with weird syntax for someone just starting up with redux-saga like me.
Agreed that it’s only very little boilerplate, but at least a mention of creating rootSaga in docs would be great.
@alfonsodev the downside is that you create iterators here, they will have different identities with each run, so its harder to test. You are also yielding an array, which is deprecated now - you should wrap that array in
all
effect.Idiomatic way of using redux-saga is to yield effects (description object) only, although yielding promises and iterators is allowed.
It is also super easy to adjust your code to use effects:
or event shorter