Created
May 14, 2013 16:56
-
-
Save vsavkin/5577548 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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