Redux Module
ReduxModule settings
Actions Props
prefix
This prefix will be setted on all actions in this module environment
Type | Required | Default value |
string | Yes | - |
defaultState
The default data for current state
Type | Required | Default value |
Object | No | null |
responseMap
This object is for setting the server response.
Default ResponseMapProps
For example:
Type | Required | Default value |
Object | No |
|
key
The name of the key in which the data will be stored
Type | Required | Default value |
string | No | data |
name
The action name. Default value depends on the action type, for example if you use createAddAction
default value will be CREATE
Type | Required | Default value |
string | No | Depends on the action |
idKey
This parameter should be used only when using one of this methods createAddAction, createUpdateAction, createDeleteAction . This property is intended to find the desired item by some identifier.
Type | Required | Default value |
string | optional | - |
apiCall
This is an API call function, that returns a Promise (required). If you want to update the store without a request to the server you can skip this property. For the store update you need to send data the first argument of the action function.
For example
Type | Required | Default value |
function | No | - |
withoutStatus
When no needed have status parameters.
Type | Required | Default value |
boolean | No | - |
returnResponse
When the server response have not structure and needed get all response data you can use this property.
Type | Required | Default value |
boolean | No | - |
withoutResponse
When there is no need to store updates after a request to the server.
Type | Required | Default value |
boolean | No | - |
alternativeResponse
When need use custom logic for response processing.
Type | Required | Default value | Arguments |
function | No | - |
|
alternativeRequest
When need use custom action or dispatch other actions.
Type | Required | Default value | Arguments |
function | No | - |
|
callback
When need call function after success response.
Type | Required | Default value | Arguments |
function | No | - |
|
Methods
Last updated