New user store structure and updated packages

This commit is contained in:
Jori Lallo
2016-06-25 23:31:22 -07:00
parent 3bbdaecbf2
commit a2a642c16c
11 changed files with 167 additions and 135 deletions

View File

@@ -1,11 +1,10 @@
import { observable, action, computed, autorun } from 'mobx';
import { observable, action, computed } from 'mobx';
import { browserHistory } from 'react-router';
import { client } from 'utils/ApiClient';
import localforage from 'localforage';
const USER_STORE = 'USER_STORE';
const store = new class UserStore {
class UserStore {
@observable user;
@observable team;
@@ -71,12 +70,9 @@ const store = new class UserStore {
this.token = data.token;
this.oauthState = data.oauthState;
}
}();
};
// Persist store to localStorage
autorun(() => {
localStorage.setItem(USER_STORE, store.asJson);
});
export default store;
export default UserStore;
export {
USER_STORE,
};