Skip to content

Interface: BoundStore<ModuleDefinition>

types/BoundStore.BoundStore

BoundStore is a proxy object around the target library store. It is provided as the 'store' to target module tasks.

Type parameters

Name Type
ModuleDefinition extends BaseModule<any, any, any>

Properties

commit

commit: <OutsideModuleDefinition, Key>(funcName: Key | `${string}/${Key}`, ...payload: ParametersExceptFirst<OutsideModuleDefinition["mutations"][Key]>) => void

Type declaration

▸ <OutsideModuleDefinition, Key>(funcName, ...payload): void

Commit commits a state change to the underlying state management library.

Type parameters
Name Type
OutsideModuleDefinition extends BaseModule<any, any, any> = ModuleDefinition
Key extends string = string & keyof OutsideModuleDefinition["mutations"]
Parameters
Name Type
funcName Key | `${string}/${Key}`
...payload ParametersExceptFirst<OutsideModuleDefinition["mutations"][Key]>
Returns

void

Defined in

src/base/types/BoundStore.ts:12


dispatch

dispatch: <Key>(funcName: Key, ...payload: ParametersExceptFirst<ModuleDefinition["tasks"][Key]>) => ReturnType<ModuleDefinition["tasks"][Key]> | <Key>(funcName: Key, ...payload: ParametersExceptFirst<ModuleDefinition["tasks"][Key]>) => ReturnType<ModuleDefinition["tasks"][Key]>

Dispatch runs a function which may have multiple commits-- this may be provided through the client library's task management, or it may be an implementation all its own.

Defined in

src/base/types/BoundStore.ts:17


makeModule

makeModule: ModuleFactory

ModuleFactory function-- this function should create a new function in the underlying state library.

Defined in

src/base/types/BoundStore.ts:29


state

state: ModuleDefinition["state"]

A getter that returns the state of the current module.

Defined in

src/base/types/BoundStore.ts:21


stateFor

stateFor: (moduleName: string) => OutsideModuleDefinition["state"]

Type declaration

▸ <OutsideModuleDefinition>(moduleName): OutsideModuleDefinition["state"]

A function that allows you to get the state of another module.

Type parameters
Name Type
OutsideModuleDefinition extends BaseModule<any, any, any>
Parameters
Name Type
moduleName string
Returns

OutsideModuleDefinition["state"]

Defined in

src/base/types/BoundStore.ts:25