Skip to content

Commit

Permalink
Grammar fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coryhouse authored Feb 12, 2017
1 parent 190d016 commit 140ef02
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 140ef02

Please sign in to comment.