Skip to content

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

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DefaultStateStore(config?): DefaultStateStore

Parameters

NameTypeDescription
config?Object-
config.cacheTtl?numberCache time to live in ms
config.enableCache?booleanEnable cache
config.enableGet?booleanEnable generally get method
config.enableRemove?booleanEnable generally remove method
config.enableSet?booleanEnable generally set method
config.logLevel?LogLevelNameA log level for new logger if logger is not set
config.logger?LoggerA logger instance

Returns

DefaultStateStore

Overrides

StateStoreBaseClass.constructor

Defined in

DefaultStateStore/DefaultStateStore.impl.ts:15

Properties

config

config: Object

Type declaration

NameTypeDescription
cacheTtl?numberCache time to live in ms
enableCache?booleanEnable cache
enableGet?booleanEnable generally get method
enableRemove?booleanEnable generally remove method
enableSet?booleanEnable generally set method
logLevel?LogLevelNameA log level for new logger if logger is not set
logger?LoggerA logger instance

Inherited from

StateStoreBaseClass.config

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:20


logger

logger: Logger

Inherited from

StateStoreBaseClass.logger

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

StateStore.name

Inherited from

StateStoreBaseClass.name

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

StateStore.destroy

Inherited from

StateStoreBaseClass.destroy

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:82


getState

getState<StateNames>(...stateNames): Promise<ObjectWithKeysFromStringArray<StateNames>>

Type parameters

NameType
StateNamesextends string[]

Parameters

NameType
...stateNamesStateNames

Returns

Promise<ObjectWithKeysFromStringArray<StateNames>>

Implementation of

StateStore.getState

Inherited from

StateStoreBaseClass.getState

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:43


getStateImpl

getStateImpl<StateNames>(...stateNames): Promise<ObjectWithKeysFromStringArray<StateNames>>

Type parameters

NameType
StateNamesextends string[]

Parameters

NameType
...stateNamesStateNames

Returns

Promise<ObjectWithKeysFromStringArray<StateNames>>

Overrides

StateStoreBaseClass.getStateImpl

Defined in

DefaultStateStore/DefaultStateStore.impl.ts:25


removeState

removeState(stateName): Promise<void>

Parameters

NameType
stateNamestring

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

NameType
stateNamestring

Returns

Promise<void>

Overrides

StateStoreBaseClass.removeStateImpl

Defined in

DefaultStateStore/DefaultStateStore.impl.ts:39


setState

setState(stateName, stateValue): Promise<void>

Parameters

NameType
stateNamestring
stateValueunknown

Returns

Promise<void>

Implementation of

StateStore.setState

Inherited from

StateStoreBaseClass.setState

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:72


setStateImpl

setStateImpl(stateName, stateValue): Promise<void>

Parameters

NameType
stateNamestring
stateValueunknown

Returns

Promise<void>

Overrides

StateStoreBaseClass.setStateImpl

Defined in

DefaultStateStore/DefaultStateStore.impl.ts:35