-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cdfa993
commit 462cf4b
Showing
2 changed files
with
21 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Thoughts on Redux | ||
|
||
## Actions describe a thing that happened | ||
|
||
Actions with names like `"SET_USER_NAME"` are a smell. Instead, prefer names like `"USERNAME_INPUT_CHANGED"`. Your actions should be a log of _facts_ and should not have any opinions about how those facts are interperated. | ||
|
||
## Actions and action creators are a global concern | ||
|
||
Reduces should know about actions, but actions should not know about your reducers. | ||
|
||
## Your state is a cache | ||
|
||
In principle, your state could simply be an array of every action that has been dispatched, and you could derive the current value by running your reducer in your selector. | ||
|
||
### What would this redux look like? How could you optimize it? | ||
|
||
- Often you need to refer to some other portion of your state within your reducer. How would you do this? | ||
|
||
## |