Skip to content

Commit

Permalink
Update: bindFlow use old callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Bacra committed Sep 10, 2018
1 parent 3f28707 commit f204bc3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion lib/deps/dep_linker.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ exports.proto = function(Linker)
var self = this;
function bindFlow(handler, name)
{
if (typeof handler != 'function') return false;
if (typeof handler.init == 'function')
{
var ret = handler.init(self);
Expand All @@ -74,7 +75,11 @@ exports.proto = function(Linker)
try {
self.flow(name, function(flow)
{
flow.register(handler);
// flow.register(handler);
flow.register(function(runtime, callback)
{
return handler.call(this, runtime, callback.toFuncCallback());
});
if (handler.methods)
{
flow.register('methods', handler.methods);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clientlinker",
"version": "7.1.2",
"version": "7.1.3",
"description": "Linker all clients whether rpc, addon, http request, mock data, local file ...",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions test/test_deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ describe('#deps', function()
expect(flow).to.be.ok();

linker.addClient('client1',
{
flows: ['flow1', 'flow_empty', 'flow_next', 'flow_resolve']
});
{
flows: ['flow1', 'flow_empty', 'flow_next', 'flow_resolve']
});

return linker.run('client1.xxxx')
.then(function(data)
Expand Down

0 comments on commit f204bc3

Please sign in to comment.