steal
Version:
Gets JavaScript.
28 lines (19 loc) • 706 B
Markdown
is aware of its parent module.
`steal.setContextual(moduleName, definer)`
{String} moduleName The name of the contextual module.
{Function|String} definer Either a function defining the module or a moduleName to import which defines the module.
## Use
Modules may want to modify their behavior based on the module that is importing them. One example would be for normalization:
```js
steal.setContextual("normalize", function(parentName){
return {
"default": function(name){
return steal.loader.normalize(name, parentName);
},
__useDefault: true
};
});
```
{function} steal.setContextual
StealJS.functions
Create a module that