data object
parent item
import * as collection from '@biorate/collection';
class Item extends collection.Item {
@embed(Item.Int) public id: number = null;
@embed(Item.String) public title: string = null;
}
const item = new Item().initialize({ id: 1, title: 'one' });
Rest
...args: any[]Rest
Callbacks storage
Static
Readonly
Arraycast to Array type symbol
Static
Readonly
Boolcast to boolean type symbol
Static
Readonly
Datecast to Date type symbol
Static
Readonly
Floatcast to float type symbol
Static
Readonly
Intcast to int type symbol
Static
Readonly
Jsoncast to JSON type symbol
Static
Readonly
Luxoncast to Luxon type symbol
Static
Readonly
Mapcast to Map type symbol
Static
Readonly
Objectcast to Object type symbol
Static
Readonly
Setcast to Set type symbol
Static
Readonly
Stringcast to string type symbol
Static
Readonly
bindingsBinding map, for IoC pattern realization
Alias to parent class
See description here
data object
Change data values
import * as collection from '@biorate/collection';
class Item extends collection.Item {
@embed(Nested.Int) public int: number = null;
@embed(Nested.String) public string: string = null;
}
const item = new Item().initialize({ int: 1, string: 'test' }});
item.set({ int: 2, string: 'hello' }});
console.log(item); // Item { int: 2, string: 'hello' }
Rest
...args: any[]Rest
Subscribe to changes
const item = new Item().initialize({ int: 1 });
const callback = (data) => console.log(data);
item.subscribe(callback);
Rest
...args: any[]Rest
Unsubscribe from changes
item.unsubscribe(callback);
Static
bindGenerated using TypeDoc
Description
The Item extensions is designed to form the structure of the object, solve the problem of application architecture, dependency injection and inversion of control.
Features:
Example