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
I'm confused about the below code and would appreciate any help!
varLayout=Marionette.LayoutView.extend({initialize: function(){varchannel=Backbone.Radio.channel('myChannel');// this succeeds (when calling with trigger())this.listenTo(channel,'myTriggerEvent',this.mySetMethod);// this also succeeds (when calling with trigger())channel.on('myTriggerEvent',this.mySetMethod);// this fails (when calling with request())this.listenTo(channel,'myRequestEvent',this.myGetMethod);// this succeeds (when calling with request())channel.reply('myRequestEvent',this.myGetMethod);},mySetMethod: function(value){console.log(value);},myGetMethod: function(){return'some value';}});
My questions are:
Is listenTo preferred or will setting a listener directly on Radio still allow Marionette to remove the listener upon view removal?
Does a reply inside a listenTo fail because it's not an on? Will Marionette ever support Radio replies inside listenTo?
I'm using Radio 1.0.0 and Marionette 2.4.1
The text was updated successfully, but these errors were encountered:
I'm confused about the below code and would appreciate any help!
My questions are:
I'm using Radio 1.0.0 and Marionette 2.4.1
The text was updated successfully, but these errors were encountered: