Skip to content

PURISTA API / Modules / @purista/core / StateStoreBaseClass

Class: StateStoreBaseClass<StateStoreConfigType>

@purista/core.StateStoreBaseClass

Base class for config store implementations The actual store implementation must overwrite the protected methods:

  • getStateImpl
  • setStateImpl
  • removeStateImpl

DO NOT OVERWRITE: the regular methods getState, setState or removeState

Type parameters

NameType
StateStoreConfigTypeextends Record<string, unknown> = {}

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new StateStoreBaseClass<StateStoreConfigType>(name, config): StateStoreBaseClass<StateStoreConfigType>

Type parameters

NameType
StateStoreConfigTypeextends Record<string, unknown> = {}

Parameters

NameType
namestring
config{ [K in string | number | symbol]: (Object & StateStoreConfigType)[K] }

Returns

StateStoreBaseClass<StateStoreConfigType>

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:24

Properties

config

config: { [K in string | number | symbol]: (Object & StateStoreConfigType)[K] }

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:20


logger

logger: Logger

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:19


name

name: string

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:22

Methods

destroy

destroy(): Promise<void>

Returns

Promise<void>

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>>

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>>

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:38


removeState

removeState(stateName): Promise<void>

Parameters

NameType
stateNamestring

Returns

Promise<void>

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:58


removeStateImpl

removeStateImpl(stateName): Promise<void>

Parameters

NameType
stateNamestring

Returns

Promise<void>

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:56


setState

setState(stateName, stateValue): Promise<void>

Parameters

NameType
stateNamestring
stateValueunknown

Returns

Promise<void>

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:72


setStateImpl

setStateImpl(stateName, stateValue): Promise<void>

Parameters

NameType
stateNamestring
stateValueunknown

Returns

Promise<void>

Defined in

core/StateStore/StateStoreBaseClass.impl.ts:69