Abstract
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' });
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
data object
Initialize object properties
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();
console.log(item); // Item { id: null, title: null }
item.initialize({ id: 1, title: 'one' });
console.log(item); // Item { id: 1, title: 'one' }
item.initialize({ id: 2, title: 'two' });
console.log(item); // Item { id: 2, title: 'two' }
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' }
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