UNPKG

ayano-react

Version:
37 lines (31 loc) 827 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _ayanoUtils = require("ayano-utils"); var DEFAULT_APP_KEY = "DEFAULT_APP_KEY"; var AppManager = { get: function get() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_APP_KEY; this.apps = this.apps || {}; return this.apps[name]; }, set: function set(name, app) { this.apps = this.apps || {}; console.log(name, app); if (app) { if ((0, _ayanoUtils.is)(_ayanoUtils.TYPES.String)(name)) { this.apps[name] = app; } else { this.apps[DEFAULT_APP_KEY] = app; } } else { this.apps[DEFAULT_APP_KEY] = name; } }, all: function all() { this.apps = this.apps || {}; return this.apps; } }; exports.default = AppManager;