UNPKG

@robotlegsjs/createjs

Version:
60 lines 3.37 kB
"use strict"; // ------------------------------------------------------------------------------ // Copyright (c) 2017-present, RobotlegsJS. All Rights Reserved. // // NOTICE: You are permitted to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // ------------------------------------------------------------------------------ Object.defineProperty(exports, "__esModule", { value: true }); exports.CreateJSBundle = void 0; var core_1 = require("@robotlegsjs/core"); var IContextView_1 = require("../../extensions/contextView/api/IContextView"); var ContextViewExtension_1 = require("../../extensions/contextView/ContextViewExtension"); var ContextView_1 = require("../../extensions/contextView/impl/ContextView"); var ContextViewListenerConfig_1 = require("../../extensions/contextView/impl/ContextViewListenerConfig"); var MediatorMapExtension_1 = require("../../extensions/mediatorMap/MediatorMapExtension"); var StageCrawlerExtension_1 = require("../../extensions/viewManager/StageCrawlerExtension"); var StageObserverExtension_1 = require("../../extensions/viewManager/StageObserverExtension"); var ViewManagerExtension_1 = require("../../extensions/viewManager/ViewManagerExtension"); /** * For that Classic Robotlegs flavour * * <p>This bundle installs a number of extensions commonly used * in typical Robotlegs applications and modules.</p> */ var CreateJSBundle = /** @class */ (function () { function CreateJSBundle() { } /*============================================================================*/ /* Public Functions */ /*============================================================================*/ /** * @inheritDoc */ CreateJSBundle.prototype.extend = function (context) { this._context = context; this._logger = context.getLogger(this); this._context.install(ContextViewExtension_1.ContextViewExtension, ViewManagerExtension_1.ViewManagerExtension, StageObserverExtension_1.StageObserverExtension, MediatorMapExtension_1.MediatorMapExtension, StageCrawlerExtension_1.StageCrawlerExtension); this._context.addConfigHandler(core_1.instanceOfType(ContextView_1.ContextView), this._handleContextView.bind(this)); this._context.whenInitializing(this._whenInitializing.bind(this)); this._context.afterDestroying(this._afterDestroying.bind(this)); }; /*============================================================================*/ /* Private Functions */ /*============================================================================*/ CreateJSBundle.prototype._handleContextView = function () { this._context.configure(ContextViewListenerConfig_1.ContextViewListenerConfig); }; CreateJSBundle.prototype._whenInitializing = function () { if (!this._context.injector.isBound(IContextView_1.IContextView)) { this._logger.error("CreateJSBundle requires IContextView."); } }; CreateJSBundle.prototype._afterDestroying = function () { this._context = null; this._logger = null; }; return CreateJSBundle; }()); exports.CreateJSBundle = CreateJSBundle; //# sourceMappingURL=CreateJSBundle.js.map