I want to implement a custom vent event aggregator instance with requirejs as explainer here
Looking at examples here and in the docs, I've seent that calls to vent.on and vent.trigger are mainly used in views. My pattern would then be:
define(['marionette', 'vent'], function (Marionette, vent) {
return Marionette.ItemView.extend({
initialize: function () {
//bind
this.listenTo(vent, 'mycustomevent', this.myMethod);
//trigger
vent.trigger('viewinit', ...);
}
});
});
Is this pattern correct (views are responsible for managing aggregator events) or should i use it on Models and Collections?