Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created May 14, 2013 16:57
Show Gist options
  • Save vsavkin/5577557 to your computer and use it in GitHub Desktop.
Save vsavkin/5577557 to your computer and use it in GitHub Desktop.
var App = new Marionette.Application();
//This object is responsible for storing user data.
var userInfo = {
favouriteLanguages: function(user){
return ["JS", "Ruby"];
}
};
//This module is responsible for displaying user data.
var userProfile = App.module("userProfile");
userProfile.addInitializer(function(opts){
var languages = opts.userInfo.favouriteLanguages("Victor");
displayLanguages(languages);
});
//Here we initialize all the modules of the application.
userProfile.start({userInfo: userInfo});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment