nodulator
Version:
Complete NodeJS Framework for Restfull APIs
36 lines (35 loc) • 1.19 kB
JavaScript
// Generated by LiveScript 1.4.0
(function(){
var EventEmitter, bus, Dependency;
EventEmitter = require('events').EventEmitter;
bus = require('./Bus');
Dependency = (function(superclass){
var prototype = extend$((import$(Dependency, superclass).displayName = 'Dependency', Dependency), superclass).prototype, constructor = Dependency;
Dependency.nextId = 1;
prototype.constructor = function(){
return this.id = Dependency.nextId++;
};
prototype._Depends = function(){
return bus.emit('depends', this);
};
prototype._Changed = function(){
return this.emit('changed', this);
};
function Dependency(){
Dependency.superclass.apply(this, arguments);
}
return Dependency;
}(EventEmitter));
module.exports = Dependency;
function extend$(sub, sup){
function fun(){} fun.prototype = (sub.superclass = sup).prototype;
(sub.prototype = new fun).constructor = sub;
if (typeof sup.extended == 'function') sup.extended(sub);
return sub;
}
function import$(obj, src){
var own = {}.hasOwnProperty;
for (var key in src) if (own.call(src, key)) obj[key] = src[key];
return obj;
}
}).call(this);