This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
2016-08-01 19:03:17 +03:00

20 lines
498 B
JavaScript

import UserStore, { USER_STORE } from './UserStore';
import UiStore, { UI_STORE } from './UiStore';
import CacheStore from './CacheStore';
import { autorunAsync } from 'mobx';
const stores = {
user: new UserStore(),
ui: new UiStore(),
cache: new CacheStore(),
};
// Persist stores to localStorage
// TODO: move to store constructors
autorunAsync(() => {
localStorage.setItem(USER_STORE, stores.user.asJson);
localStorage.setItem(UI_STORE, stores.ui.asJson);
});
export default stores;