UNPKG

1.22 kBJavaScriptView Raw
1(function() {
2 var Director, Messenger,
3 __hasProp = Object.prototype.hasOwnProperty,
4 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
5
6 Director = require("../concrete/director");
7
8 Messenger = require("./messenger");
9
10 module.exports = (function(_super) {
11
12 __extends(_Class, _super);
13
14 function _Class() {
15 _Class.__super__.constructor.apply(this, arguments);
16 }
17
18 _Class.prototype.passive = false;
19
20 /*
21 */
22
23 _Class.prototype._newMessenger = function(message, middleware) {
24 return new Messenger(message, middleware, this);
25 };
26
27 /*
28 */
29
30 _Class.prototype.getListeners = function(message) {
31 return this.prepareListeners(_Class.__super__.getListeners.call(this, message));
32 };
33
34 /*
35 */
36
37 _Class.prototype.prepareListeners = function(listeners) {
38 if (!!listeners.length) {
39 return [listeners[0]];
40 } else {
41 return [];
42 }
43 };
44
45 return _Class;
46
47 })(Director);
48
49}).call(this);