diff --git a/docs/recipes/reducers/PrerequisiteConcepts.md b/docs/recipes/reducers/PrerequisiteConcepts.md index 828d744ac8..01db9ae7fc 100644 --- a/docs/recipes/reducers/PrerequisiteConcepts.md +++ b/docs/recipes/reducers/PrerequisiteConcepts.md @@ -4,7 +4,7 @@ As described in [Reducers](../../basics/Reducers.md), a Redux reducer function: - Should have a signature of `(previousState, action) => newState`, similar to the type of function you would pass to [`Array.prototype.reduce(reducer, ?initialValue)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce) -- Should be "pure", which means it does not mutate its arguments, perform side effects like API calls or modifying values outside of the function, or call non-pure functions like `Date.now()` or `Math.random()`. This also means that updates should be done in an ***"immutable"*** fashion, which means **always returning new objects with the updated data**, rather than directly modifying the original state tree in-place. +- Should be "pure", which means it does not mutate its arguments, perform side effects like API calls or modify values outside of the function, or call non-pure functions like `Date.now()` or `Math.random()`. This also means that updates should be done in an ***"immutable"*** fashion, which means **always returning new objects with the updated data**, rather than directly modifying the original state tree in-place. >##### Note on immutability, side effects, and mutation > Mutation is discouraged because it generally breaks time-travel debugging, and React Redux's `connect` function: