@robotlegsjs/pixi
Version:
PIXI View Integration with RobotlegsJS
61 lines • 3.43 kB
JavaScript
;
// ------------------------------------------------------------------------------
// 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.PixiBundle = void 0;
var core_1 = require("@robotlegsjs/core");
var eventemitter3_1 = require("@robotlegsjs/eventemitter3");
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 PixiBundle = /** @class */ (function () {
function PixiBundle() {
}
/*============================================================================*/
/* Public Functions */
/*============================================================================*/
/**
* @inheritDoc
*/
PixiBundle.prototype.extend = function (context) {
this._context = context;
this._logger = context.getLogger(this);
this._context.install(eventemitter3_1.LocalEventEmitterMapExtension, 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 */
/*============================================================================*/
PixiBundle.prototype._handleContextView = function () {
this._context.configure(ContextViewListenerConfig_1.ContextViewListenerConfig);
};
PixiBundle.prototype._whenInitializing = function () {
if (!this._context.injector.isBound(IContextView_1.IContextView)) {
this._logger.error("PixiBundle requires IContextView.");
}
};
PixiBundle.prototype._afterDestroying = function () {
this._context = null;
this._logger = null;
};
return PixiBundle;
}());
exports.PixiBundle = PixiBundle;
//# sourceMappingURL=PixiBundle.js.map