I'm creating a Marionette web app using requirejs. I override the maronette view renderer to support my custom template objects like this:
Marionette.Renderer.render = function(template, data){
return template.render(data);
};
This configuration is global to all the views. My problem is: Where is the best place to put this code(and similar config like this - example overridden 'sync' function in backbone) maintaining the modularity obtained via requirejs?
The options I could think of are:
- Simply put it in the app or main file - seems like a quick n dirty way
- Put all the custom config for all libraries in a config file and requiring it.
- Make a file like MarionetteConfig or BackboneConfig and put the config specific to that library in that file and require that file.
What is the better way to do it?
Thanks..