Comparing version 0.1.0 to 0.1.1
@@ -158,3 +158,3 @@ ;(function(root, factory) { | ||
return function handle(msgs, end) { | ||
node.child.handle(msgs, node, end); | ||
node.child.handle(msgs, node, node, end); | ||
}; | ||
@@ -171,3 +171,3 @@ } | ||
return function handle(msgs, parent, end) { | ||
return function handle(msgs, parent, source, end) { | ||
msgs = castArray(msgs).map(castMessage); | ||
@@ -178,13 +178,16 @@ | ||
while (++i < n) schedule({ | ||
var taskDefaults = { | ||
source: source, | ||
parent: parent, | ||
}; | ||
while (++i < n) schedule(conj(taskDefaults, { | ||
msg: msgs[i], | ||
parent: parent, | ||
end: noop | ||
}); | ||
})); | ||
if (n > -1) schedule({ | ||
if (n > -1) schedule(conj(taskDefaults, { | ||
msg: msgs[n], | ||
parent: parent, | ||
end: end | ||
}); | ||
})); | ||
}; | ||
@@ -213,15 +216,18 @@ | ||
var fn = fns[task.msg.type] || fns['*']; | ||
return fn | ||
? fn(state, task.msg.value, task.parent.def, node.graph) | ||
: [state, task.msg]; | ||
return !fn | ||
? [state, task.msg] | ||
: fn(state, task.msg.value, { | ||
source: task.source.def, | ||
parent: task.parent.def, | ||
dispatch: node.graph.dispatch | ||
}); | ||
} | ||
function done(msgs) { | ||
var end = task.end; | ||
var currTask = task; | ||
isBusy = false; | ||
task = null; | ||
if (node.child) node.child.handle(msgs, node, end); | ||
else end(); | ||
if (node.child) node.child.handle(msgs, node, currTask.source, currTask.end); | ||
else currTask.end(); | ||
@@ -228,0 +234,0 @@ next(); |
{ | ||
"name": "flume-core", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "core library for flume", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
10395
332