Skip to main content

Class: ConfigStore<T>

Defined in: plugin/configStore.ts:26

A class to manage the configuration state for plugins in a Redux store.

Type Parameters​

Type ParameterDescription
TThe type of the configuration object.

Constructors​

Constructor​

new ConfigStore<T>(configKey: string): ConfigStore<T>;

Defined in: plugin/configStore.ts:34

Creates an instance of the ConfigStore class.

Parameters​

ParameterTypeDescription
configKeystringThe key to identify the specific plugin configuration.

Returns​

ConfigStore<T>

Methods​

get()​

get(): T;

Defined in: plugin/configStore.ts:70

Retrieves the current configuration for the specified key from the Redux store.

Returns​

T

The current configuration object.


set()​

set(configValue: T): void;

Defined in: plugin/configStore.ts:45

Sets the entire configuration for a specific plugin.

This method will overwrite the entire configuration object for the given key.

Parameters​

ParameterTypeDescription
configValueTThe new configuration object.

Returns​

void


update()​

update(partialUpdates: Partial<T>): void;

Defined in: plugin/configStore.ts:61

Updates the configuration for a specific plugin.

This method will merge the provided partial updates into the current configuration object.

Parameters​

ParameterTypeDescription
partialUpdatesPartial<T>An object containing the updates to be merged into the current configuration.

Returns​

void


useConfig()​

useConfig(): () => T;

Defined in: plugin/configStore.ts:82

Creates a custom React hook for accessing the plugin's configuration state reactively.

This hook allows components to access and react to changes in the plugin's configuration.

Returns​

A custom React hook that returns the configuration state.

() => T