The backbone module of magic is not recommended, what is a good alternative to handling initializers and triggering events?

Like my headline, I see that the Marionette module is now deprecated, and we should use AMD modules instead of requirejs. This is great, and everything except the modules has a big goal in handling initializers and events: start and start. This allowed me to easily customize my regions, views, and collections. What is the alternative for this?

Below is an example of the code that I would use:

define(['core', './views/mainView'], function(core, mainView) {
    var app = core.app;
    app.start();

return core.app.module('Home Page Module', function(Module) {
    Module.addInitializer(function() {
        this.region = new core.Marionette.Region({
            el: '#page-container'
        });
        this.collection = [];
    });

    Module.on('start', function() {
        this.view = new mainView({
            collection: this.collection
        });
        this.region.show(this.view);
    });
});
});
+4
source share
1 answer

I have no answer, but Derick Bailey, the creator of Marionette, has one.

- / . . , , , . Theres Ill Marionette, , , .

: http://derickbailey.com/2014/06/10/browserify-my-new-choice-for-modules-in-a-browser-backbone-app/

( ), , - .

+2

All Articles