Last active
June 29, 2016 01:37
-
-
Save franzese/019d50abe00124c52860775487268dbf to your computer and use it in GitHub Desktop.
Globally accessible IIFE structure
This file contains 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
// ensure namescope is available.. define it globally | |
var Via = Via || {}; | |
// pass global var | |
(function(Via) { | |
Via.startMsg = 'Ready!'; | |
Via._isDev = true; | |
Via.init = function() { | |
Via.log(Via.startMsg); | |
}; | |
Via.log = function(msg) { | |
if(Via._isDev) | |
console.log(msg) | |
}; | |
// jq document ready | |
$(Via.init()); | |
})(Via); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment