You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a customised version of `createAsyncThunk` with defaulted options.
776
+
777
+
Options specified when calling `createAsyncThunk` will override options specified in `createAsyncThunkCreator`.
778
+
775
779
### Options
776
780
777
781
An object with the following optional fields:
778
782
779
-
- `serializeError(error: any, defaultSerializer: (error:any) =>SerializedError) =>GetSerializedErrorType<ThunkApiConfig>` to replace or extend the default internal serializer method with your own serialization logic.
783
+
- `serializeError(error: unknown) =>GetSerializedErrorType<ThunkApiConfig>` to replace or extend the default serializer method with your own serialization logic.
784
+
- `idGenerator(arg: unknown) =>string`: a function to use when generating the `requestId` for the request sequence. Defaults to use [nanoid](./otherExports.mdx/#nanoid), but you can implement your own ID generation logic.
780
785
781
786
### Return Value
782
787
783
-
`createAsyncThunkCreator` returns a Redux thunk action creator with customized options. Currently, the only option is `serializeError`.
788
+
A version of `createAsyncThunk` that has options defaulted to the values provided.
0 commit comments