Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move fertilize and breed actions to drake reducer
Part of work to clean up the root reducer to make further refactoring easier. Both these actions only affect the `drakes` property, so can be handled entirely by the drakes reducer. The one issue is that `fertilize` needs additional information from elsewhere in the state tree, namely the gametes. While we could maybe completely restructure the state, or add an all-purpose way for all reducers to get the entire state (reduxjs/redux#601 (comment)) it seemed more natural simply to let the drakes reducer know about the gametes. This pattern can be applied elsewhere when a reducer is only updating one property, but needs knowledge about other state props.
- Loading branch information
Showing
2 changed files
with
47 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters