mirror of
https://github.com/sergeyyarkov/educt-client.git
synced 2026-10-11 10:19:22 +03:00
41 lines
766 B
TypeScript
41 lines
766 B
TypeScript
import { makeAutoObservable } from 'mobx';
|
|
import { API_BASE_URL } from '../constants';
|
|
|
|
/**
|
|
* Services
|
|
*/
|
|
import ApiService from 'services/ApiService';
|
|
|
|
/**
|
|
* Stores
|
|
*/
|
|
import AuthStore from './AuthStore';
|
|
import UserStore from './UserStore';
|
|
|
|
export default class RootStore {
|
|
public authStore: AuthStore;
|
|
|
|
public userStore: UserStore;
|
|
|
|
public apiService: ApiService;
|
|
|
|
constructor() {
|
|
/**
|
|
* Api service
|
|
*/
|
|
this.apiService = new ApiService(this, {
|
|
baseURL: API_BASE_URL,
|
|
responseType: 'json',
|
|
withCredentials: true,
|
|
});
|
|
|
|
/**
|
|
* Stores
|
|
*/
|
|
this.authStore = new AuthStore(this, this.apiService.api);
|
|
this.userStore = new UserStore(this, this.apiService.api);
|
|
|
|
makeAutoObservable(this);
|
|
}
|
|
}
|