Created
October 8, 2018 21:18
-
-
Save StevenMDixon/81005b22f9b58e6ea1bdac2726fd1537 to your computer and use it in GitHub Desktop.
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
store = Redux.createStore(reducer, initialstate, enhancer); | |
manages what the state lookslike. centralized location for state. | |
function rootReducer(state= initialState, action){ | |
return state | |
} | |
var initialState = { | |
count: 0 | |
} | |
store{ | |
dispatch() changes the state. has to have an action object with a type key | |
getState() returns the current state | |
} | |
steps: | |
create a reducer | |
create a store | |
get state with store.getstate | |
to change dispatch an action that is an object with a key of type | |
write a function that returns an object or an action, hey factory functions! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment