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