uStoreProvider services providerState - XMPieLab/uStore-NG GitHub Wiki
Represents the state management for the provider. This class provides methods to interact with the state store.
Kind: global class
Constructs a new ProviderState instance. Initializes the state store.
Retrieves the dispatch function from the store.
Kind: instance property of ProviderState
Returns: function - The dispatch function.
Retrieves the subscribe function from the store.
Kind: instance property of ProviderState
Returns: function - The subscribe function.
Retrieves the current state from the store.
Kind: instance method of ProviderState
Returns: Object - The current state object.
Sets the state in the store.
Kind: instance method of ProviderState
| Param | Type | Description |
|---|---|---|
| state | Object |
The new state to set. |
Sets the initial state in the store.
Kind: instance method of ProviderState
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. |
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. |
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. |
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. |
Clears the state in the store.
Kind: instance method of ProviderState