Skip to main content

Main Settings


store#

Parameters#

TypeRequiredDescription
Storetrue if you need use persists functionState tree of your app

storage#

Currently, supported for web windows.localStorage for react-native @react-native-async-storage/async-storage

Parameters#

TypeRequiredDefaultDescription
wondows.localSorage or AsycStoragetrue if you need use persists functionwondows.localSorage (for web only)-

handleResponse#

If you need to globally handle the API call response manually and it will spread to all actions.

Parameters#

TypeRequiredDefaultDescription
(data: any) => voidfalseundefinedApi 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#

TypeRequiredDefaultDescription
{ name: string, error: any, action: Function }falseundefined-

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#

TypeRequiredDefaultDescription
() => voidfalseundefined-
Exodus.resetStore()

Note I f you wat to use resetStore method , need add createRootReducer