UNPKG

@fakel/rest-admin

Version:

An application that makes it easier to work with your API

38 lines (37 loc) 1.15 kB
import { makeObservable, observable } from 'mobx'; export var AppStatuses; (function (AppStatuses) { AppStatuses["PENDING"] = "pending"; AppStatuses["READY"] = "ready"; AppStatuses["ERROR"] = "error"; })(AppStatuses || (AppStatuses = {})); var AppStore = /** @class */ (function () { function AppStore() { this.appStatus = AppStatuses.PENDING; this.appName = ''; this.appLogo = ''; makeObservable(this, { appStatus: observable, }); } AppStore.prototype.setAppName = function (name) { this.appName = name; }; AppStore.prototype.setAppLogo = function (logo) { this.appLogo = logo; }; AppStore.prototype.setStatus = function (status) { this.appStatus = status; }; AppStore.prototype.isReady = function () { return this.appStatus === AppStatuses.READY; }; AppStore.prototype.isPending = function () { return this.appStatus === AppStatuses.PENDING; }; AppStore.prototype.isError = function () { return this.appStatus === AppStatuses.ERROR; }; return AppStore; }()); export { AppStore };