UNPKG

olympus-r

Version:

一个力求简单易用的前端开发框架 #### 开发语言 TypeScript #### 核心架构 MVC #### 模块间通讯和解耦 采用事件机制,利用一个全局唯一的事件派发器进行模块间通讯,解耦模块间依赖 #### 表现层结构 使用桥接模式拆分接口与实现,达到一套核心驱动多套表现层的目的(目前支持DOM、Egret、PixiJS三种表现层),同时支持表现层的未来可扩展性 #### TypeScript装饰器注入 框架提供TypeScript装饰器注入功能,便捷获取托管对象。例如:

71 lines (70 loc) 1.81 kB
/** * @author Raykid * @email initial_r@qq.com * @create date 2017-09-18 * @modify date 2017-09-18 * * 消息基类 */ var Message = /** @class */ (function () { function Message(type) { /** * 消息派发内核列表 * * @type {IObservable} * @memberof Message */ this.__observables = []; this._type = type; } Object.defineProperty(Message.prototype, "__type", { /** * 获取消息类型字符串 * * @readonly * @type {string} * @memberof Message */ get: function () { return this._type; }, enumerable: true, configurable: true }); Object.defineProperty(Message.prototype, "__observable", { /** * 消息当前所属内核 * * @type {IObservable} * @memberof Message */ get: function () { return this.__observables[0]; }, enumerable: true, configurable: true }); Object.defineProperty(Message.prototype, "__oriObservable", { /** * 消息所属的原始内核(第一个派发到的内核) * * @type {IObservable} * @memberof Message */ get: function () { return this.__observables[this.__observables.length - 1]; }, enumerable: true, configurable: true }); /** * 再次发送消息,会使用首个内核重新发送该消息 * * @memberof Message */ Message.prototype.redispatch = function () { this.__oriObservable.dispatch(this); }; return Message; }()); export default Message;