Classes · @purista/dapr-sdk
DaprStateStore
State store adapter backed by a Dapr state component.
Signature
class DaprStateStore Constructors
1 entry
constructor
Constructor
new constructor(config?: { cacheTtl: number; clientConfig: DaprClientConfig; enableCache: boolean; enableGet: boolean; enableRemove: boolean; enableSet: boolean; ... }) Creates a Dapr-backed state store.
Properties
3 entries
config
Property
config: { cacheTtl: number; clientConfig: DaprClientConfig; enableCache: boolean; enableGet: boolean; enableRemove: boolean; enableSet: boolean; ... } Store configuration including operation toggles.
logger
Property
logger: Logger Child logger scoped to the store name.
name
Property
name: string Store name used in logs and diagnostics.
Methods
7 entries
destroy
Method
destroy(): Promise<void> Shutdown hook for store adapters.
getState
Method
getState<StateNames>(...stateNames: StateNames): Promise<ObjectWithKeysFromStringArray<StateNames>> Get one or more state values by name.
getStateImpl
Method
getStateImpl<StateNames>(...stateNames: StateNames): Promise<ObjectWithKeysFromStringArray<StateNames>> Reads one or more state values from the configured Dapr component.
removeState
Method
removeState(stateName: string): Promise<void> Remove one state value by name.
removeStateImpl
Method
removeStateImpl(stateName: string): Promise<void> Removes a state value from the configured Dapr component.
setState
Method
setState(stateName: string, stateValue: unknown): Promise<void> Store or replace one state value.
setStateImpl
Method
setStateImpl(stateName: string, stateValue: unknown): Promise<void> Writes a state value to the configured Dapr component.