hyper-chain
Advanced tools
Comparing version
@@ -214,2 +214,20 @@ // Generated by CoffeeScript 1.12.7 | ||
}; | ||
chain.await = function(name_at_group, fn) { | ||
internal_fns.push(function(exe_ctx) { | ||
var _fail, _ok, a_done, group, name, ref, task_promise; | ||
a_done = exe_ctx.createAsyncPoint(name_at_group); | ||
fn.call(exe_ctx, exe_ctx.cur, a_done); | ||
_ok = function() { | ||
return exe_ctx.resume(); | ||
}; | ||
_fail = function(err) { | ||
exe_ctx.error = err; | ||
return exe_ctx.resume(); | ||
}; | ||
ref = _.split(name_at_group, '@'), name = ref[0], group = ref[1]; | ||
task_promise = exe_ctx.getMergedPromise(name); | ||
return task_promise.then(_ok, _fail); | ||
}); | ||
return chain; | ||
}; | ||
chain.makePromise = function(name_at_group, fn) { | ||
@@ -216,0 +234,0 @@ internal_fns.push(function(exe_ctx) { |
{ | ||
"name": "hyper-chain", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "function builder for reactive programing. support promise, node-callback and designed for robust error handling. ", | ||
@@ -5,0 +5,0 @@ "main": "lib", |
48387
-8.2%9
-10%684
-18.57%