Comparing version 0.1.3 to 0.1.4
@@ -940,3 +940,4 @@ (function(e, a) { for(var i in a) e[i] = a[i]; }(this, /******/ (function(modules) { // webpackBootstrap | ||
visitedNodesMap[f.flow.guid()] = true; | ||
route.push({ flow: f.flow, route: f.route.reverse() }); | ||
var r = [f.flow].concat(f.route.reverse()); | ||
route.push({ flow: f.flow, route: r }); | ||
} | ||
@@ -943,0 +944,0 @@ }); |
{ | ||
"name": "nflow", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "event/data/control flow", | ||
@@ -5,0 +5,0 @@ "main": "dist/nflow.js", |
@@ -18,3 +18,4 @@ import {isDetached} from '../utils' | ||
visitedNodesMap[f.flow.guid()] = true | ||
route.push({ flow:f.flow, route:f.route.reverse()}) | ||
var r = [f.flow].concat(f.route.reverse()) | ||
route.push({ flow:f.flow, route:r}) | ||
} | ||
@@ -21,0 +22,0 @@ }) |
@@ -194,3 +194,39 @@ import flow from 'nflow' | ||
}) | ||
describe('foo', ()=>{ | ||
it('should traverse events', function(){ | ||
sut.on('test', ()=>{}) | ||
var a = sut.create('a') | ||
.on('test', ()=>{ }) | ||
var test = a | ||
.emit('b') | ||
.emit('c') | ||
.emit('test') | ||
var route = test.emit.route.DEFAULT(test) | ||
var map = route.map(f=>f.flow.name()) | ||
console.log(map) | ||
expect(map.join()).to.eql('test,c,b,a,sut') | ||
}) | ||
it('should record route to upstream recipients', function(){ | ||
var a = sut.create('a') | ||
.on('test', ()=>{}) | ||
var test = a | ||
.emit('b') | ||
.emit('c') | ||
.emit('test') | ||
console.log(test.emit.recipients) | ||
var recipient = test.emit.recipients[0] | ||
var recipientMap = recipient.route.map(f=>f.name()) | ||
expect(recipient.flow).to.eql(a) | ||
expect(recipientMap.join()).to.eql('a,b,c,test') | ||
}) | ||
}) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2253303
21833
2