(require("@owe/core"))(object, binding, typeopt) → {object}
Binds the given object to a binding object that wraps a router and/or closer function. This usually is the preferred way to call this function.
Parameters
| Name | Type | Attributes | Default | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object |
object | The object that should be bound. |
||||||||||||||
binding |
object | An object containing a router and closer function. Properties
|
||||||||||||||
type |
Binding.type | string |
<optional> |
"normal" | The way |
Returns
The object that was bound. If type was "clone" the bound cloned object is returned, object elsewise.
- Type
- object
(require("@owe/core"))(object, routernullable, closernullable, typeopt) → {object}
Binds the given object to a router and closer function.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
object |
object | The object that should be bound. |
||
router |
function |
<nullable> |
The router that should be used. |
|
closer |
function |
<nullable> |
The closer that should be used. |
|
type |
Binding.type | string |
<optional> |
"normal" | The way |
Returns
The object that was bound. If type was "clone" the bound cloned object is returned, object elsewise.
- Type
- object
Members
Methods
module:@owe/core(object, binding, typeopt) → {object}
Binds the given object to a binding object that wraps a router and/or closer function. This usually is the preferred way to call this function.
Parameters
| Name | Type | Attributes | Default | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object |
object | The object that should be bound. |
||||||||||||||
binding |
object | An object containing a router and closer function. Properties
|
||||||||||||||
type |
Binding.type | string |
<optional> |
"normal" | The way |
Returns
The object that was bound. If type was "clone" the bound cloned object is returned, object elsewise.
- Type
- object
module:@owe/core(object, routernullable, closernullable, typeopt) → {object}
Binds the given object to a router and closer function.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
object |
object | The object that should be bound. |
||
router |
function |
<nullable> |
The router that should be used. |
|
closer |
function |
<nullable> |
The closer that should be used. |
|
type |
Binding.type | string |
<optional> |
"normal" | The way |
Returns
The object that was bound. If type was "clone" the bound cloned object is returned, object elsewise.
- Type
- object
(inner) api(object, router, closer, typeopt) → {Api}
Behaves like the @owe/core function but returns an Api instead of the given object. If object is already bound, router, closer and type are optional and api() simply returns an Api instance for the given object.
Parameters
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
object |
object | The object that should be bound. |
||
router |
function | The router that should be used. |
||
closer |
function | The closer that should be used. |
||
type |
Binding.type | string |
<optional> |
Binding.types.normal | The way |
(inner) isApi(api) → {boolean}
Returns whether the given object is an Api instance.
Parameters
| Name | Type | Description |
|---|---|---|
api |
any | The api to check. This can be any value. The method will always return false for non-objects. |