Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"You can only make functions into Conduits." #3

Open
ghost opened this issue Aug 11, 2014 · 2 comments · May be fixed by #4
Open

"You can only make functions into Conduits." #3

ghost opened this issue Aug 11, 2014 · 2 comments · May be fixed by #4

Comments

@ghost
Copy link

ghost commented Aug 11, 2014

When running the example using postal.when-0.2.0, postal-0.10.1, conduit-0.3.2, lodash-2.4.1-compat, in Chrome v36, I received the following error:

"You can only make functions into Conduits." from conduit.js

By adding an explicit, empty callback function to each of the channels, the issue appears to have gone away.

postal.when([
    { channel: "ChannelA", topic: "topic.on.channel.a", callback: function() {} },
    { channel: "ChannelB", topic: "topic.on.channel.b", callback: function() {} },
    { channel: "ChannelC", topic: "topic.on.channel.c", callback: function() {} },
    { channel: "ChannelD", topic: "topic.on.channel.d", callback: function() {} },
], function(a, b, c, d){
    _.each(arguments, function(x) {
        $('body').append("<div>" + x + "</div>");
    });
});

postal.publish( { channel: "ChannelD", topic: "topic.on.channel.d", data: "And it's testable!" } );
postal.publish( { channel: "ChannelB", topic: "topic.on.channel.b", data: "Deferred behavior!" } );
postal.publish( { channel: "ChannelA", topic: "topic.on.channel.a", data: "Hey look!" } );
postal.publish( { channel: "ChannelC", topic: "topic.on.channel.c", data: "Via message bus!" } ); 

Hopefully this help. Thanks for your hard work on postal.when. It's very helpful.

@ifandelse
Copy link
Contributor

@jjcode ah - thanks for the heads-up on this. I'll look at adding default no-op callbacks under the hood if one isn't provided.

joashc added a commit to joashc/postal.when that referenced this issue Oct 24, 2014
Fixes Issue postaljs#3:
"You can only make functions into Conduits."
postaljs#3
@joashc joashc linked a pull request Oct 24, 2014 that will close this issue
@cordovapolymer
Copy link

@ifandelse @jjcode bump!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants