uStoreProvider services providerState - XMPieLab/uStore-NG GitHub Wiki

ProviderState

Represents the state management for the provider. This class provides methods to interact with the state store.

Kind: global class

new ProviderState()

Constructs a new ProviderState instance. Initializes the state store.

providerState.dispatch ⇒ function

Retrieves the dispatch function from the store.

Kind: instance property of ProviderState
Returns: function - The dispatch function.

providerState.subscribe ⇒ function

Retrieves the subscribe function from the store.

Kind: instance property of ProviderState
Returns: function - The subscribe function.

providerState.get() ⇒ Object

Retrieves the current state from the store.

Kind: instance method of ProviderState
Returns: Object - The current state object.

providerState.set(state)

Sets the state in the store.

Kind: instance method of ProviderState

Param Type Description
state Object The new state to set.

providerState.setInitState()

Sets the initial state in the store.

Kind: instance method of ProviderState

providerState.setCustomState(name, value)

Sets a custom state variable in the store.

Kind: instance method of ProviderState

Param Type Description
name string The name of the custom variable.
value * The value to set for the custom variable.

providerState.setBulkCustomState(obj)

Sets multiple custom state variables in the store.

Kind: instance method of ProviderState

Param Type Description
obj Object An object containing key-value pairs of custom variable names and values.

providerState.deleteCustomState(name)

Deletes a custom state variable from the store.

Kind: instance method of ProviderState

Param Type Description
name string The name of the custom variable to delete.

providerState.mergeCustomState(newState)

Merges new state into the custom state in the store.

Kind: instance method of ProviderState

Param Type Description
newState Object The new state object to merge.

providerState.clear()

Clears the state in the store.

Kind: instance method of ProviderState

⚠️ **GitHub.com Fallback** ⚠️