Methods
conbo(namespace, …globalsopt) → {conbo.Namespace}
Create or access a ConboJS namespace
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
namespace |
string | The selected namespace | |
globals |
* |
<optional> <repeatable> |
Globals to minify followed by function to execute, with each of the globals as parameters |
Returns:
- Type
- conbo.Namespace
Examples
// Conbo can replace the standard minification pattern with modular namespace definitions
// If an Object is returned, its contents will be added to the namespace
conbo('com.example.namespace', window, document, conbo, function(window, document, conbo, undefined)
{
// The executed function is scoped to the namespace
var ns = this;
// ... Your code here ...
// Optionally, return an Object containing values to be added to the namespace
return { MyApp, MyView };
});
// Retrieve a namespace and import classes defined elsewhere
var ns = conbo('com.example.namespace');
ns.import({ MyApp, MyView });