A
A
Andrew2017-09-15 23:19:56
React
Andrew, 2017-09-15 23:19:56

How gross violation is it considered to write logic in a reducer and not in an action?

How gross is it to write logic in a reducer and not in an action?
how to stick to this, it doesn't always work out to keep reducers clean
example prntscr.com/glnbs3 prntscr.com/glnazt when I write this kind of code am I showing my inexperience? Do I need to fight it and take it to the action? does it violate the purity of the function? could this be a problem? why is that bad?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hazrat Hajikerimov, 2017-09-16
@hazratgs

By convention, reducers should remain pure functions, and for your solution, you can use asynchronous actions to keep the logic in the actions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question