Main Settings
#
store#
ParametersType | Required | Description |
---|---|---|
Store | true if you need use persists function | State tree of your app |
#
storageCurrently, supported for web windows.localStorage
for react-native @react-native-async-storage/async-storage
#
ParametersType | Required | Default | Description |
---|---|---|---|
wondows.localSorage or AsycStorage | true if you need use persists function | wondows.localSorage (for web only) | - |
#
handleResponseIf you need to globally handle the API call response manually and it will spread to all actions.
#
ParametersType | Required | Default | Description |
---|---|---|---|
(data: any) => void | false | undefined | Api call response |
Exodus.init({ handleResponse: (data) => { // your code here return //.... } })
#
onErrorThe global error handler. This function will be call every time catch error in the action result
#
ParametersType | 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() } } })
#
resetStoreReset redux state and set default values
#
ParametersType | Required | Default | Description |
---|---|---|---|
() => void | false | undefined | - |
Exodus.resetStore()
Note I f you wat to use resetStore method , need add createRootReducer