Status
redux-structure-factory
Factory module to create a redux structure
Installation
TBD
Usage
Container configuration
Configuration object
{
'label': 'Some Name',
'defaultState': {},
'actions': {
'ACTION_KEY': {
'actionName': 'An action',
'actionCreator': function(...payload){ ... },
'reducerAction': function(state, action) { ... }
}
},
'filter': {
'filterName': function(...filterArgs){ ... }
}
}
Description
| Field Name | Type | Description |
|---|---|---|
| label | string | Redux container label. If not existing, registered name will be used. Mandatory: false |
| defaultState | object | Default state. If no default state is defined an empty object will be used. Mandatory: false |
| actions | object | Holds all actions with it's respective action creator function and reducer function Mandatory: true |
| ACTION_KEY | object | Name of the action. It will be automatically converted to Mandatory: true |
| actionName | string | Descriptive text of the action. Mandatory: true |
| actionCreator | function | Creates a valid action for processing the calculation of the new state. Only pure JSON (see also http://json.org/) values are allowed. Other value types will be stringified with Mandatory: false
|
| reducerAction | function | Calculates the new partial state the container is responsible for. If no return value is present for the reducer, the factory takes care of returning the original state. Mandatory: true
|
| filter | object | Contains functions to filter the state. Mandatory: false |
| filterName | function | Filters the state and returns only the information wanted. Mandatory: false
|
API
TBD
License
This module is licensed under the GNU GENERAL PUBLIC LICENSE Version 3. For more details have a look inside the LICENSE file or visit the official page.