Skip to content

Instantly share code, notes, and snippets.

@phiggins42
Created March 5, 2012 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phiggins42/1980899 to your computer and use it in GitHub Desktop.
Save phiggins42/1980899 to your computer and use it in GitHub Desktop.
define(["dojo"], function(dojo){
return function(node, command, args){
// summary: a magic function
// example:
// magic("foo", "byId");
// example:
// magic(widget, "connect", "onClick", function(e){ })
// example:
// magic("bar", "style", { color: "red" });
// example:
// magic(".nodes", "query").forEach(function(n){ ... })
// example:
// magic([1,2,3], "forEach", function(item, idx, list){ ... });
return dojo[command].apply(dojo, dojo._toArray(arguments, 2, [node])); // Anything
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment