Im currently planning a large scale Angular 6 application, and trying to find an approach for handling side effects that is best suitable to the team needs.
I realize that the most common way of doing it in the Ngrx ecosystem is by using the ngrx/effects library, and i was wondering what are the advantages of using it in comparison to thunk approach, which seems to be the most popular approach for React apps.
I get the idea of isolating all the side-effect causing logic in a single place, I always tend to isolate them under the Action Creators scope. Moving all the side effects logic to a different "abstraction layer" feels like it would add more overhead to writing a side-effect action, without considerable added value, as most of the "intense logic" actions are for handling side effects.
Is there any other reason to favor effects over thunks? Is there any fundamental difference between ngrx in Angular and the classic Redux for React, that makes ngrx/effect a better pick?
The difference in the React/Redux stack maybe if you make use of sagas instead of thunks (https://github.com/redux-saga/redux-saga) as with a thunk you can generate a lot of side effects with one action but with saga you can generate many async action from a single action, and every action has its own scope so debug, code split, and separation of concerns is easier.
ngrx/effects uses the power of rxjs (Observable) and is more for an angular environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With