Created
October 30, 2017 11:01
-
-
Save Salman18/1090fb3bd5fbc72c3fcee8d4b32b3d66 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 reducer = ( state = [],action) => { | |
if (action.type === 'split_string') { | |
return action.payload.split(''); | |
} | |
return state; | |
}; | |
const store = Redux.createStore(reducer); | |
store.getState(); | |
const action = { | |
type: 'split_string', | |
payload: 'AMCAT' | |
}; | |
store.dispatch(action); | |
store.getState(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment