Comparing version 1.0.0 to 1.1.1
15
index.js
@@ -14,3 +14,3 @@ 'use strict' | ||
function Instance(model) { | ||
function Instance(model, emitter) { | ||
/*this.flow = flow | ||
@@ -22,3 +22,3 @@ this.id = id*/ | ||
this.middlewares = [] | ||
this.internalEmitter = new flowEmitter(); | ||
this.internalEmitter = emitter | ||
} | ||
@@ -80,6 +80,2 @@ | ||
Instance.prototype.on = function (eventName, eventFunction) { | ||
this.internalEmitter.on(eventName, eventFunction) | ||
} | ||
Instance.prototype.register = function (name, fn) { | ||
@@ -99,6 +95,7 @@ this.middlewares[name] = fn | ||
this.instances = [] | ||
this.internalEmitter = new flowEmitter(); | ||
} | ||
Flow.prototype.newInstance = function (id) { | ||
this.instances[id] = new externals.Instance(this.model) | ||
this.instances[id] = new externals.Instance(this.model, this.internalEmitter) | ||
return this.instances[id] | ||
@@ -116,2 +113,6 @@ } | ||
Flow.prototype.on = function (eventName, eventFunction) { | ||
this.internalEmitter.on(eventName, eventFunction) | ||
} | ||
return Flow | ||
@@ -118,0 +119,0 @@ |
{ | ||
"name": "flowx", | ||
"version": "1.0.0", | ||
"version": "1.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4965
95