Created
January 17, 2018 19:54
-
-
Save Sstobo/60dbc56ae55a0775feb2a5ba185dc3f0 to your computer and use it in GitHub Desktop.
[React Redux vocabulary] #
This file contains hidden or 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
REDUX GIVES YOU THE STORE, DISPATCH AND REDUCERS | |
### | |
store holds state | |
state is 0 | |
click the +1 button | |
'dispatches an action (which is action and state) to reducer | |
switch in reducer = if ActionType = type(increment) and payload (1), use the increment switch in the reducer to add 1 to state | |
state gets send back to store | |
### | |
Currying = calling a function with fewer arguments than it expects | |
Use redux if: | |
Its gonna be a big project | |
If its shared | |
If its persisted | |
Reducer - how does action change state . SHOULD BE CALLED UPDATER | |
Action - sent off (dispatched) contain data (payloads) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment