import { observable, action, computed } from 'mobx';

export default class AppStore {
  
  @observable type = 'agent';
  @observable isLoading = false;

  constructor(context) {
    this.context = context;
    this.http = context.http;
  }

  @action
  getAppType() {
    this.isLoading = true;

    return this.http.get("app/type")
      .then(res => {
        this.isLoading = false;
        this.type = res.type;
        return res;
      })
      .catch(err => {
        this.isLoading = false;
        throw err;
      })
  }

}
