Skip to content

Instantly share code, notes, and snippets.

@bryanforbes
Created February 21, 2012 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bryanforbes/1879352 to your computer and use it in GitHub Desktop.
Save bryanforbes/1879352 to your computer and use it in GitHub Desktop.
define(["module", "my/base/xhr"], function(module, xhr){
return {
wire$plugin: function authPlugin(ready, destroyed, options){
var providers = options.providers || [];
return {
ready: function(resolver, proxy, wire){
if(proxy.spec.module == module.id){
wire(providers).then(function(context){
console.log(context);
resolver.resolve();
});
}
}
};
}
};
});
var wire = {
plugins: [
{ module: "wire/debug" },
{
module: "my/wire/authentication",
providers: [
["/foo", { module: "my/testProvider" }],
["/bar", { module: "my/testProvider" }]
]
}
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment