Constructor
new Model(name, func) → {Object}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
Name of the model |
func |
Mole.Peripherals.Model~function
|
object
|
A callback that returns an object for the model |
Returns:
- Type:
-
Object
An object with a name, a func, and an optional output property
Example
// Example using `add()` method
mole.add(
new Model('model-name', function(data) {
return // The object you'd like to return which sets the data model
})
)
Type Definitions
function(data, theme) → {object}
Callback for returning a data model
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
data |
object
|
Access to the data model |
theme |
object
|
Access the original theme data |
Returns:
- Type:
-
object
An object which replaces or adds to the existing data model