Skip to content

Commit

Permalink
fix(fluent): channel & Transponder in utils was not returning this fo…
Browse files Browse the repository at this point in the history
…r fluent chaining of handlers l

affects: @tao.js/utils
  • Loading branch information
eudaimos committed Aug 13, 2019
1 parent 55d37cf commit df35d6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/tao-utils/src/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,19 @@ export default class Channel {
{ t, term, a, action, o, orient },
handler
);
return this;
}

addAsyncHandler({ t, term, a, action, o, orient }, handler) {
// this._kernel.addAsyncHandler({ t, term, a, action, o, orient }, handler);
this._channel.addAsyncHandler({ t, term, a, action, o, orient }, handler);
return this;
}

addInlineHandler({ t, term, a, action, o, orient }, handler) {
// this._kernel.addInlineHandler({ t, term, a, action, o, orient }, handler);
this._channel.addInlineHandler({ t, term, a, action, o, orient }, handler);
return this;
}

removeInterceptHandler({ t, term, a, action, o, orient }, handler) {
Expand All @@ -98,6 +101,7 @@ export default class Channel {
{ t, term, a, action, o, orient },
handler
);
return this;
}

removeAsyncHandler({ t, term, a, action, o, orient }, handler) {
Expand All @@ -106,6 +110,7 @@ export default class Channel {
{ t, term, a, action, o, orient },
handler
);
return this;
}

removeInlineHandler({ t, term, a, action, o, orient }, handler) {
Expand All @@ -114,6 +119,7 @@ export default class Channel {
{ t, term, a, action, o, orient },
handler
);
return this;
}

bridgeFrom(TAO, ...trigrams) {
Expand Down
6 changes: 6 additions & 0 deletions packages/tao-utils/src/Transponder.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,34 +123,40 @@ export default class Transponder {
{ t, term, a, action, o, orient },
handler
);
return this;
}

addAsyncHandler({ t, term, a, action, o, orient }, handler) {
this._channel.addAsyncHandler({ t, term, a, action, o, orient }, handler);
return this;
}

addInlineHandler({ t, term, a, action, o, orient }, handler) {
this._channel.addInlineHandler({ t, term, a, action, o, orient }, handler);
return this;
}

removeInterceptHandler({ t, term, a, action, o, orient }, handler) {
this._channel.removeInterceptHandler(
{ t, term, a, action, o, orient },
handler
);
return this;
}

removeAsyncHandler({ t, term, a, action, o, orient }, handler) {
this._channel.removeAsyncHandler(
{ t, term, a, action, o, orient },
handler
);
return this;
}

removeInlineHandler({ t, term, a, action, o, orient }, handler) {
this._channel.removeInlineHandler(
{ t, term, a, action, o, orient },
handler
);
return this;
}
}

0 comments on commit df35d6b

Please sign in to comment.