Files
freeCodeCamp/common/app/flux/Store.js
Berkeley Martinez a1a4ac883d add user stores/actions
construct fetchr on every request
2015-07-24 22:27:52 -07:00

19 lines
433 B
JavaScript

import { Store } from 'thundercats';
const { createRegistrar, setter } = Store;
const initValue = {
username: null,
picture: null,
points: 0
};
export default Store(initValue)
.refs({ displayName: 'AppStore' })
.init(({ instance: appStore, args: [cat] }) => {
const { setUser } = cat.getActions('appActions');
const register = createRegistrar(appStore);
register(setter(setUser));
return appStore;
});