UNPKG

@chix/flow

Version:
40 lines 1.59 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var util_1 = require("../util"); var callbackWrapper_1 = require("./callbackWrapper"); function $Delegate(Base) { return (function (_super) { __extends(Delegate$, _super); function Delegate$() { return _super !== null && _super.apply(this, arguments) || this; } Delegate$.prototype._delegate = function (output) { var fn = output.splice(0, 1).pop(); var method = output.splice(0, 1).pop(); output.push(this._callbackWrapper.bind(this)); fn[method].apply(fn, output); }; return Delegate$; }(Base)); } exports.$Delegate = $Delegate; (function ($Delegate) { function create(Base) { return util_1.mixin($Delegate, callbackWrapper_1.$CallbackWrapper.create)(Base); } $Delegate.create = create; })($Delegate = exports.$Delegate || (exports.$Delegate = {})); //# sourceMappingURL=delegate.js.map