Skip to content

Instantly share code, notes, and snippets.

@liezl200
Created February 8, 2017 08:34
Show Gist options
  • Save liezl200/4a2d3f9171d65780c34c23e1a9a7aebb to your computer and use it in GitHub Desktop.
Save liezl200/4a2d3f9171d65780c34c23e1a9a7aebb to your computer and use it in GitHub Desktop.
const reducer = (state=[], action) => {
if (action.type === 'splitstr') {
return action.payload.split('');
}
return state;
}
const store = Redux.createStore(reducer);
store.getState();
const action = {type: 'splitstr', payload: 'asdf'};
store.dispatch(action);
store.getState();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment