Skip to main content

Class: ConfigStore<T>

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

Type Parameters

Type ParameterDescription
TThe type of the configuration object.

Constructors

new ConfigStore()

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

Creates an instance of the ConfigStore class.

Parameters

ParameterTypeDescription
configKeystringThe key to identify the specific plugin configuration.

Returns

ConfigStore<T>

Defined in

src/plugin/configStore.ts:34

Methods

get()

get(): T

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

Returns

T

The current configuration object.

Defined in

src/plugin/configStore.ts:70


set()

set(configValue: T): void

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

Defined in

src/plugin/configStore.ts:45


update()

update(partialUpdates: Partial<T>): void

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

Defined in

src/plugin/configStore.ts:61


useConfig()

useConfig(): () => T

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

Function

A custom React hook that returns the configuration state.

Returns

T

Defined in

src/plugin/configStore.ts:82