Skip to content

PURISTA API


PURISTA API / @purista/core / StateStoreBaseClass

Class: abstract StateStoreBaseClass<StateStoreConfigType>

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:20

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

Extended by

Type Parameters

StateStoreConfigType

StateStoreConfigType extends Record<string, unknown> = EmptyObject

Constructors

Constructor

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

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:26

Parameters

name

string

config

{ [K in string | number | symbol]: ({ cacheTtl?: number; enableCache?: boolean; enableGet?: boolean; enableRemove?: boolean; enableSet?: boolean; logger?: Logger; logLevel?: LogLevelName } & StateStoreConfigType)[K] }

Returns

StateStoreBaseClass<StateStoreConfigType>

Properties

config

config: { [K in string | number | symbol]: ({ cacheTtl?: number; enableCache?: boolean; enableGet?: boolean; enableRemove?: boolean; enableSet?: boolean; logger?: Logger; logLevel?: LogLevelName } & StateStoreConfigType)[K] }

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:22


logger

logger: Logger

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:21


name

name: string

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:24

Methods

destroy()

destroy(): Promise<void>

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:84

Returns

Promise<void>


getState()

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

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:45

Type Parameters

StateNames

StateNames extends string[]

Parameters

stateNames

...StateNames

Returns

Promise<ObjectWithKeysFromStringArray<StateNames>>


getStateImpl()

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

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:40

Type Parameters

StateNames

StateNames extends string[]

Parameters

stateNames

...StateNames

Returns

Promise<ObjectWithKeysFromStringArray<StateNames>>


removeState()

removeState(stateName): Promise<void>

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:60

Parameters

stateName

string

Returns

Promise<void>


removeStateImpl()

abstract protected removeStateImpl(stateName): Promise<void>

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:58

Parameters

stateName

string

Returns

Promise<void>


setState()

setState(stateName, stateValue): Promise<void>

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:74

Parameters

stateName

string

stateValue

unknown

Returns

Promise<void>


setStateImpl()

abstract protected setStateImpl(stateName, stateValue): Promise<void>

Defined in: packages/core/src/core/StateStore/StateStoreBaseClass.impl.ts:71

Parameters

stateName

string

stateValue

unknown

Returns

Promise<void>