Skip to content

Instantly share code, notes, and snippets.

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