4 ms·
Happy to see people trying to solve this problem. Can you talk about how this compares to redux-saga?
by tarr11 9y ago
Happy to see people trying to solve this problem. Can you talk about how this compares to redux-saga?
- acemarke 9y agoPretty sure they're solving very different problems. redux-saga is about managing side effects using generators, particularly in response to dispatched actions. redux-tiles is largely about abstracting the logic for creating and dispatching actions and applying nested updates in reducers.
- bloomca 9y agoThanks! As @acemarke mentioned, they are really different (and there is nothing to stop you from using them together, if you want -- tiles expose constants). Even if you use redux-saga for all side effects, you would still have to write some redux code, e.g. for `usedLoggedIn`, and even it is the easiest action and reducer, it will take from you about 30 LoC. And usually we tend to group reducer hanlders together, combining only the higher level (so, usually there is only `user`, but only in case of big amount of actions we will separate `userAuth`). So, I've tried to make it as easy as possible to nest them (so you would use type like `['user', 'auth']`), and to nest data under let's say ids. You don't have to think about it -- there is just a little amount of magic under the hood, which will nest it, merge data and combine reducers. So, saga adresses side effects problem (especially when they are pretty complicated, and depend on each other), while this library provides some sugar on top of raw redux "ducks".