Extends
- Backbone.Collection
Members
components :Object.<Lateralus.Component>
The subcomponents belonging to this object. Do not modify this property directly, it is managed by Lateralus.
- Mixes In:
- Source:
Type:
-
Object.<Lateralus.Component>
lateralusEvents :Object|undefined
A map of functions or string references to functions that will
handle events dispatched to the
central
instance.Lateralus
const ExtendedComponent = Lateralus.Component.extend({
name: 'extended',
lateralusEvents: {
anotherComponentChanged: 'onAnotherComponentChanged',
anotherComponentDestroyed: function () {
// ...
}
},
onAnotherComponentChanged: function () {
// ...
}
});
- Mixes In:
- Default Value:
- undefined
- Source:
Type:
-
Object
|undefined
modelEvents :Object|undefined
A map of functions or string references to functions that will
handle events emitted by
this.model
.
const ExtendedComponent = Lateralus.View.extend({
modelEvents: {
changed:someProperty: function (model, someProperty) {
// ...
}
}
});
- Mixes In:
- Default Value:
- undefined
- Source:
Type:
-
Object
|undefined
provide :Object|undefined
A map of functions that will handle
calls. Each of the functions attached to this Object should return a
value. These functions must be completely synchronous.Lateralus.mixins#collect
const App = Lateralus.beget(function () {
Lateralus.apply(this, arguments);
});
_.extend(App.prototype, {
provide: {
demoData: function () {
return 1;
}
}
});
const app = new App();
const ComponentSubclass = Lateralus.Component.extend({
name: 'provider',
provide: {
demoData: function () {
return 2;
}
}
});
app.addComponent(ComponentSubclass);
console.log(app.collect('demoData')); // [1, 2]
- Mixes In:
- Source:
Type:
-
Object
|undefined
Methods
remove(models, optionsopt)
Remove a
or array of Lateralus.Component.Model
s from this collection.Lateralus.Component.Model
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
models |
Array.<Lateralus.Component.Model>
|
Lateralus.Component.Model
|
||||||||||
options |
Object
|
<optional> |
This object is also passed to Backbone.Collection.#remove.
|
toString() → {string}
- Source:
Returns:
- Type:
-
string
The name of this Collection. This is used internally by Lateralus.