Skip to content

Instantly share code, notes, and snippets.

@btg5679
Last active July 14, 2017 02:00
Show Gist options
  • Save btg5679/6dcf095cc1e355cd895b5bd433ab49b1 to your computer and use it in GitHub Desktop.
Save btg5679/6dcf095cc1e355cd895b5bd433ab49b1 to your computer and use it in GitHub Desktop.
import { createStore } from 'redux';
const store = createStore(r, {
user: {
name: 'wacko',
age: 48
},
commentCount: 2,
loginHistory: {
loginDate: '2017-01-01',
result: 'success'
},
...
});
//Action dispatched to your Store
store.dispatch({ type: 'CMT', payload: 1 });
//Called any time an action is dispatched
store.subscribe(());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment