Namespace for datasources
Classes
- DomStorage
- Server
The Server class encapsulates the access to a server datasource
- Storage
The Storage class encapsulates the access to data objects over WebStorageAPI.
Namespaces
Members
defaults
Derived classes can override and extend this method as follows.
Derived classes can override and extend this method as follows.
get defaults() {
return Object.assign({}, super.defaults, {
myValue:true
});
}
(static) instanceSymbol
This method is called by the
instanceof
operator.This method is called by the instanceof
operator.
- Since
- 2.1.0
Methods
attachObserver(observer) → {Datasource}
attach a new observer
.attach a new observer
Parameters:
Name | Type | Description |
---|---|---|
observer | Observer |
Returns:
- Type:
- Datasource
containsObserver(observer) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
observer | Observer |
Returns:
- Type:
- boolean
detachObserver(observer) → {Datasource}
detach a observer
.detach a observer
Parameters:
Name | Type | Description |
---|---|---|
observer | Observer |
Returns:
- Type:
- Datasource
get() → {Object|Array}
Returns real object
.Returns real object
Returns:
- Type:
- Object |
Array
getOption(path, defaultValue) → {*}
nested options can be specified by path a.b.c
nested options can be specified by path a.b.c
Parameters:
Name | Type | Description |
---|---|---|
path | string | |
defaultValue | * |
Returns:
- Type:
- *
read() → {Promise}
Throws:
this method must be implemented by derived classes.
- Type
- Error
Returns:
- Type:
- Promise
set(data) → {Datasource}
Parameters:
Name | Type | Description |
---|---|---|
data | Object | |
Returns:
- Type:
- Datasource
setOption(path, value) → {Datasource}
Set option
.Set option
Parameters:
Name | Type | Description |
---|---|---|
path | string | |
value | * |
Returns:
- Type:
- Datasource
setOptions(options) → {Datasource}
Parameters:
Name | Type | Description |
---|---|---|
options | string | |
Throws:
the options does not contain a valid json definition
- Type
- Error
Returns:
- Type:
- Datasource
write() → {Promise}
Throws:
this method must be implemented by derived classes.
- Type
- Error
Returns:
- Type:
- Promise
Type Definitions
exampleCallback(value, key)
This callback can be passed to a datasource and is used to adapt data structures.
This callback can be passed to a datasource and is used to adapt data structures.
Parameters:
Name | Type | Description |
---|---|---|
value | * | Value |
key | string | Key |