Skip to content

Commit

Permalink
Merge pull request reduxjs#2239 from coryhouse/patch-10
Browse files Browse the repository at this point in the history
Grammar fix
  • Loading branch information
markerikson authored Feb 12, 2017
2 parents 190d016 + 140ef02 commit 8c8dc8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/recipes/reducers/PrerequisiteConcepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8c8dc8b

Please sign in to comment.