Add node context/flow/global

This commit is contained in:
Nick O'Leary
2015-12-29 22:16:51 +00:00
parent b95dc2ecce
commit 5ead3342cc
6 changed files with 203 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ var when = require("when");
var redUtil = require("../util");
var Log = require("../log");
var context = require("./context");
var flows = require("./flows");
function Node(n) {
@@ -63,6 +63,12 @@ Node.prototype.updateWires = function(wires) {
}
}
Node.prototype.context = function() {
if (!this._context) {
this._context = context.get(this._alias||this.id,this.z);
}
return this._context;
}
Node.prototype._on = Node.prototype.on;