Skip to content

Instantly share code, notes, and snippets.

@mauriciosoares
Last active August 29, 2015 14:01
Show Gist options
  • Save mauriciosoares/ace667c6ac8e2000e962 to your computer and use it in GitHub Desktop.
Save mauriciosoares/ace667c6ac8e2000e962 to your computer and use it in GitHub Desktop.
var App = App || {};
Module = function(ns_string) {
var parts = ns_string.split('.'),
parent = App,
i;
if(parts[0] == 'App') {
parts = parts.slice(1);
}
for(i = 0; i < parts.length; i += 1) {
if(typeof parent[parts[i]] === 'undefined') {
parent[parts[i]] = {};
}
parent = parent[parts[i]];
}
}
Module('App.Ueba.Hue');
Module('App.Ueba.Alan');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment