PURISTA API / Modules / @purista/core / DefaultStateStore
Class: DefaultStateStore
@purista/core.DefaultStateStore
The DefaultStateStore is a placeholder which offers all needed methods. Getters and setters will throw a UnhandledError with status Not implemented
Hierarchy
StateStoreBaseClass
<DefaultStateStoreConfig
>↳
DefaultStateStore
Implements
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new DefaultStateStore(config?
): DefaultStateStore
Parameters
Name | Type | Description |
---|---|---|
config? | Object | - |
config.cacheTtl? | number | Cache time to live in ms |
config.enableCache? | boolean | Enable cache |
config.enableGet? | boolean | Enable generally get method |
config.enableRemove? | boolean | Enable generally remove method |
config.enableSet? | boolean | Enable generally set method |
config.logLevel? | LogLevelName | A log level for new logger if logger is not set |
config.logger? | Logger | A logger instance |
Returns
Overrides
StateStoreBaseClass.constructor
Defined in
DefaultStateStore/DefaultStateStore.impl.ts:15
Properties
config
• config: Object
Type declaration
Name | Type | Description |
---|---|---|
cacheTtl? | number | Cache time to live in ms |
enableCache? | boolean | Enable cache |
enableGet? | boolean | Enable generally get method |
enableRemove? | boolean | Enable generally remove method |
enableSet? | boolean | Enable generally set method |
logLevel? | LogLevelName | A log level for new logger if logger is not set |
logger? | Logger | A logger instance |
Inherited from
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:20
logger
• logger: Logger
Inherited from
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:19
map
• Private
map: Map
<string
, unknown
>
Defined in
DefaultStateStore/DefaultStateStore.impl.ts:14
name
• name: string
name of store
Implementation of
Inherited from
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:22
Methods
destroy
▸ destroy(): Promise
<void
>
disconnects and shuts down the state store
Returns
Promise
<void
>
Implementation of
Inherited from
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:82
getState
▸ getState<StateNames
>(...stateNames
): Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
Type parameters
Name | Type |
---|---|
StateNames | extends string [] |
Parameters
Name | Type |
---|---|
...stateNames | StateNames |
Returns
Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
Implementation of
StateStore.getState
Inherited from
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:43
getStateImpl
▸ getStateImpl<StateNames
>(...stateNames
): Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
Type parameters
Name | Type |
---|---|
StateNames | extends string [] |
Parameters
Name | Type |
---|---|
...stateNames | StateNames |
Returns
Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
Overrides
StateStoreBaseClass.getStateImpl
Defined in
DefaultStateStore/DefaultStateStore.impl.ts:25
removeState
▸ removeState(stateName
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
Returns
Promise
<void
>
Implementation of
StateStore.removeState
Inherited from
StateStoreBaseClass.removeState
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:58
removeStateImpl
▸ removeStateImpl(stateName
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
Returns
Promise
<void
>
Overrides
StateStoreBaseClass.removeStateImpl
Defined in
DefaultStateStore/DefaultStateStore.impl.ts:39
setState
▸ setState(stateName
, stateValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
stateValue | unknown |
Returns
Promise
<void
>
Implementation of
StateStore.setState
Inherited from
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:72
setStateImpl
▸ setStateImpl(stateName
, stateValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
stateValue | unknown |
Returns
Promise
<void
>
Overrides
StateStoreBaseClass.setStateImpl