Skip to content

Instantly share code, notes, and snippets.

@kara-ryli
Created December 20, 2012 01:31
Show Gist options
  • Save kara-ryli/4342289 to your computer and use it in GitHub Desktop.
Save kara-ryli/4342289 to your computer and use it in GitHub Desktop.
Potential enhancement to YUI's loader API allowing module-level skin selection and avoiding naming collisions.
YUI({
groups: {
group1: { modules: ["mymodule": {}], base: "http://group1..." },
group2: { modules: ["mymodule": {}], base: "http://group2..." },
}
}).use(
// maintain current usage
"node",
// allow specifying skins at the module level
{ name: "slider", skin: "round-dark" /* or ["sam", "round-dark"] */ },
// allow specifying groups to avoid naming collisions
{ name: "mymodule", group: "group2" }
), function (Y) {
// your code is ready!
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment