peterkr
peterkr

Reputation: 421

Marionettejs - How to unsubscribe from Vent function subscribed?

How can I unsubcribe from Vent function that subcribed already with 'On' method

Vent = new Backbone.Wreqr.EventAggregator();
Vent.on("change:caption", function(){
  console.log("caption changed");
});
Vent.trigger("change:caption");

Is there is anyway to remove / stop listening to "change:caption" from *Vent._event* stack?

Thanks Peter

Upvotes: 1

Views: 707

Answers (1)

pdoherty926
pdoherty926

Reputation: 10399

Vent.off("change:caption"); //unsubscribe

Upvotes: 1

Related Questions