Files
freeCodeCamp/common/app/flux/Store.js

25 lines
545 B
JavaScript
Raw Normal View History

import { Store } from 'thundercats';
const { createRegistrar, setter, fromMany } = Store;
const initValue = {
title: 'Learn To Code | Free Code Camp',
username: null,
picture: null,
points: 0
};
export default Store({
refs: {
displayName: 'AppStore',
value: initValue
},
init({ instance: appStore, args: [cat] }) {
2015-10-27 20:07:28 -07:00
const { goTo, setUser, setTitle } = cat.getActions('appActions');
const register = createRegistrar(appStore);
2015-10-27 20:07:28 -07:00
register(setter(fromMany(setUser, setTitle, goTo)));
return appStore;
}
});