mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-21 06:13:33 +00:00
24 lines
472 B
TypeScript
24 lines
472 B
TypeScript
import store from "../store";
|
|
import { setGlobalState } from "../store/modules/global";
|
|
import userService from "./userService";
|
|
|
|
const globalService = {
|
|
getState: () => {
|
|
return store.getState().global;
|
|
},
|
|
|
|
initialState: async () => {
|
|
const defaultGlobalState = {};
|
|
|
|
try {
|
|
await userService.initialState();
|
|
} catch (error) {
|
|
// do nth
|
|
}
|
|
|
|
store.dispatch(setGlobalState(defaultGlobalState));
|
|
},
|
|
};
|
|
|
|
export default globalService;
|