Skip to content

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

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions