Files
freeCodeCamp/common/app/flux/Store.js
Berkeley Martinez c82b2e3ae6 set and render page title
note this requires changes to thundercats to work
see: thundercatsjs/thundercats-react/issues/3
2015-07-29 10:18:06 -07:00

21 lines
517 B
JavaScript

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(initValue)
.refs({ displayName: 'AppStore' })
.init(({ instance: appStore, args: [cat] }) => {
const { setUser, setTitle } = cat.getActions('appActions');
const register = createRegistrar(appStore);
register(setter(fromMany(setUser, setTitle)));
return appStore;
});