Constructor
(abstract) new DataBase(paramsopt, classConfigopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
|
classConfig |
Help4.jscore.DataBase.Params |
<optional> |
- Source:
Extends
Members
(static) RETRIEVE_KEYS :string
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
initialize |
'initialize' | |
update |
'update' | |
activate |
'activate' |
- Source:
Methods
(protected) ____defineDataFunctions()
- Overrides:
- Source:
(protected) ____defineProperties(params)
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
- Overrides:
- Source:
Throws:
Error
(protected) ____defineProperty(args)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
Object |
Properties
|
- Overrides:
- Source:
(protected) ____defineStaticProperties()
auto define all to be cleaned properties
- Overrides:
- Source:
Throws:
Error
(protected) ____extendParams(dest, src) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
dest |
Object | |
src |
Object |
- Overrides:
- Source:
Returns:
- Type
- Object
(protected) ____getClassConfig() → {Help4.jscore.Base.Params}
- Overrides:
- Source:
Returns:
(protected) ____getData() → {Object}
- Overrides:
- Source:
Returns:
- Type
- Object
(protected) ____mergeDerivedParams(level0, level1)
Parameters:
Name | Type | Description |
---|---|---|
level0 |
Help4.jscore.Base.Params | |
level1 |
Help4.jscore.Base.Params |
- Overrides:
- Source:
Throws:
Error
(protected) ____resolveDerivedParams(classConfig)
Parameters:
Name | Type | Description |
---|---|---|
classConfig |
Help4.jscore.Base.Params |
- Overrides:
- Source:
(protected) ____setInitValue(args)
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
Object |
Properties
|
- Overrides:
- Source:
(protected) _destroyControl(…keys)
destroys class properties
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
keys |
string |
<repeatable> |
- Overrides:
- Source:
(protected) _fireEvent(event) → {Help4.jscore.Base}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Help4.jscore.Base
(async, protected) _fireEvent2(event) → {Promise.<Array.<Help4.EmbeddedEvent.EventResponse>>}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Promise.<Array.<Help4.EmbeddedEvent.EventResponse>>
(protected) _fireEventSync(event) → {Array.<Help4.EmbeddedEvent.EventResponse>}
fires an event that can be observed from outside
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | the event to be fired |
- Overrides:
- Source:
Returns:
- Type
- Array.<Help4.EmbeddedEvent.EventResponse>
(protected) _onAfterRetrieve(key)
called after a retrieve operation completed
Parameters:
Name | Type | Description |
---|---|---|
key |
string | the value that has changed |
- Source:
(async, protected) _onRetrieveReady(key) → {Promise.<void>}
called after a retrieve operation completed; retrieve will await this function
Parameters:
Name | Type | Description |
---|---|---|
key |
string | the value that has changed |
- Source:
Returns:
- Type
- Promise.<void>
activate() → {Promise.<void>}
update data on activate
- Source:
Returns:
- Type
- Promise.<void>
addListenerSync(eventType, listener) → {Help4.jscore.Base}
add an event listener
Parameters:
Name | Type | Description |
---|---|---|
eventType |
string | Array.<string> | event type to be observed |
listener |
Help4.EmbeddedEvent.Listener | the callback function |
- Overrides:
- Source:
Returns:
- Type
- Help4.jscore.Base
clean()
cleans all stored data
- Source:
destroy()
destroys this instance
- Overrides:
- Source:
(generator) entries()
allows to iterate the existing data
- Source:
Yields:
[number, *]}
initialize()
update data on initialize
returns {Promise}
- Source:
isDestroyed() → {boolean}
whether instance is destroyed
- Overrides:
- Source:
Returns:
- Type
- boolean
update() → {Promise.<void>}
update data on update
- Source:
Returns:
- Type
- Promise.<void>
Type Definitions
Config
additional class configuration
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
onPropertyChange |
function |
<optional> |
sync listener for property change events |
- Source:
Data
the actually managed data
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
Help4.jscore.ControlBase.Types | data type | ||
cleanup |
boolean |
<optional> |
false | whether to clean the data on class destroy |
init |
* | the init value | ||
retrieve |
Help4.jscore.DataBase.Retrieve | when to update the data |
- Source:
Params
Type:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object |
<optional> |
data parameters; each is of type Help4.jscore.DataBase.Data |
retrieve |
Object |
<optional> |
how to update the data: {<key>: async function getValueForKey} |
config |
Help4.jscore.DataBase.Config |
<optional> |
class configuration |
- Source:
Retrieve
retrieve configuration; when to update data;
see also Help4.jscore.DataBase.RETRIEVE_KEYS
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
onInitialize |
boolean | retrieve data on initialize |
onUpdate |
boolean | retrieve data on update |
onActivate |
boolean | retrieve data on activate |
- Source: