-
-
Save azamsharp/412efc3797fc72c5d6e2870a68fe8000 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
const redux = require('redux') | |
const createStore = redux.createStore | |
const initialState = { | |
posts : [] | |
} | |
const rootReducer = (state = initialState, action) => { | |
return state | |
} | |
const store = createStore(rootReducer) | |
// subscriptions | |
store.subscribe(() => { | |
console.log("Subscription Fired!") | |
}) | |
store.dispatch({ type : "INCREMENT_COUNTER" }) | |
console.log(store.getState()) | |
store.dispatch({ type : "ADD_COUNTER", value : 10}) | |
console.log(store.getState()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment