mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 01:20:24 +03:00
Merge pull request #739 from acelaya-forks/feature/rtk-errors
Changed how errors are serialized by async thunks
This commit is contained in:
commit
ee7a091586
1 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,12 @@
|
|||
import { createAsyncThunk as baseCreateAsyncThunk, AsyncThunkPayloadCreator } from '@reduxjs/toolkit';
|
||||
import { identity } from 'ramda';
|
||||
import { ShlinkState } from '../../container/types';
|
||||
|
||||
export const createAsyncThunk = <Returned, ThunkArg>(
|
||||
typePrefix: string,
|
||||
payloadCreator: AsyncThunkPayloadCreator<Returned, ThunkArg, { state: ShlinkState }>,
|
||||
) => baseCreateAsyncThunk(typePrefix, payloadCreator);
|
||||
payloadCreator: AsyncThunkPayloadCreator<Returned, ThunkArg, { state: ShlinkState, serializedErrorType: any }>,
|
||||
) => baseCreateAsyncThunk(
|
||||
typePrefix,
|
||||
payloadCreator,
|
||||
{ serializeError: identity },
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue