Main Settings
store#
Parameters#
| Type | Required | Description |
|---|---|---|
| Store | true if you need use persists function | State tree of your app |
storage#
Currently, supported for web windows.localStorage for react-native @react-native-async-storage/async-storage
Parameters#
| Type | Required | Default | Description |
|---|---|---|---|
wondows.localSorage or AsycStorage | true if you need use persists function | wondows.localSorage (for web only) | - |
handleResponse#
If you need to globally handle the API call response manually and it will spread to all actions.
Parameters#
| Type | Required | Default | Description |
|---|---|---|---|
| (data: any) => void | false | undefined | Api call response |
Exodus.init({ handleResponse: (data) => { // your code here return //.... } })onError#
The global error handler. This function will be call every time catch error in the action result
Parameters#
| Type | Required | Default | Description |
|---|---|---|---|
{ name: string, error: any, action: Function } | false | undefined | - |
Note "OnError" return your current action, and you can re call your action again if need it. You need only call function without any params all params are bind or if you want update it you can pass any values.
Exodus.init({ onError: ({ name, error, action }) => { if (name === 'YOUR_ACTION_NAME') { // call again action() } } })
resetStore#
Reset redux state and set default values
Parameters#
| Type | Required | Default | Description |
|---|---|---|---|
() => void | false | undefined | - |
Exodus.resetStore()Note I f you wat to use resetStore method , need add createRootReducer