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
Name | Type |
---|---|
StateStoreConfigType | extends Record <string , unknown > = {} |
Hierarchy
StateStoreBaseClass
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new StateStoreBaseClass<StateStoreConfigType
>(name
, config
): StateStoreBaseClass
<StateStoreConfigType
>
Type parameters
Name | Type |
---|---|
StateStoreConfigType | extends Record <string , unknown > = {} |
Parameters
Name | Type |
---|---|
name | string |
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
Name | Type |
---|---|
StateNames | extends string [] |
Parameters
Name | Type |
---|---|
...stateNames | StateNames |
Returns
Promise
<ObjectWithKeysFromStringArray
<StateNames
>>
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
>>
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:38
removeState
▸ removeState(stateName
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
Returns
Promise
<void
>
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:58
removeStateImpl
▸ removeStateImpl(stateName
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
Returns
Promise
<void
>
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:56
setState
▸ setState(stateName
, stateValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
stateValue | unknown |
Returns
Promise
<void
>
Defined in
core/StateStore/StateStoreBaseClass.impl.ts:72
setStateImpl
▸ setStateImpl(stateName
, stateValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
stateName | string |
stateValue | unknown |
Returns
Promise
<void
>