Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to configure createAsyncThunk for a custom serializeError #4548

Open
jesperjohansson opened this issue Aug 7, 2024 · 0 comments
Open

Comments

@jesperjohansson
Copy link

Instead of having to provide serializeError to the options of every createAsyncThunk call it would be nice to be able to provide your own serializeError default implementation for all thunks.

Suggestions:

  • Add an createAsyncThunkCreator
const createAppAsyncThunk = createAsyncThunkCreator({
  serializeError(error) {
    return mySerializer(error)
  }
})

In my case I would like to add a new property isAxiosError to all the serialized errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant