You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have support in the hub for custom behaviours of handlers based on returned types.
Imagine this could work:
// Widget 1:define(["troopjs-widget/component"],function(Widget){returnWidget.extend({"hub/topic": function(){returnAggregate("FOO");}});});// Widget 2:define(["troopjs-widget/component"],function(Widget){returnWidget.extend({"hub/topic": function(){returnAggregate("BAR");// Aggregate is a custom return type which// aggregates return values of all handlers of this hub topic.}});});// Service:define(["troopjs-core/component/gadget","troopjs-core/pubsub/hub"],function(Gadget,hub){returnGadget.extend({"sig/start": function(){returnhub.publish("topic").then(function(data){// 'data' is an aggregation of the return values of// all the handlers for this topicconsole.log(data);// ["FOO", "BAR"]});}});});
The text was updated successfully, but these errors were encountered:
How would one indicate to the runner that the return is of a behavior type?
My personal feeling is that instead of having a registry (the first thing that jumped into my mind) we should have a way of ducktyping behavior enabled return values. This would reduce the amount of boilerplate needed and would probably be efficient enough.
Remember that this is somewhat hot code (every handler for any message passed).
Also, in what runners do we need this? From my understanding only the hub runner would need this.
Have support in the hub for custom behaviours of handlers based on returned types.
Imagine this could work:
The text was updated successfully, but these errors were encountered: