A note about pure functions

Redux reducers should be pure functions. As we discussed earlier in this chapter, pure functions are related to functional programming and are supposed to be stable. Given the same inputs, they should always return the same outputs. To guarantee that, pure functions cannot rely on the external state. Also, pure functions should not have side effects.

Here's a useful reference to understand what pure functions are: https://medium.com/javascript-scene/master-the-javascript-interview-what-is-a-pure-function-d1c076bec976#.uw1h6nv66.

With Redux, reducers are organized as a tree; each reducer only takes care of specific action types.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.134.102.182