mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 01:48:18 +03:00
14 lines
521 B
TypeScript
14 lines
521 B
TypeScript
|
import type { AsyncThunkPayloadCreator } from '@reduxjs/toolkit';
|
||
|
import { createAsyncThunk as baseCreateAsyncThunk } from '@reduxjs/toolkit';
|
||
|
import { identity } from 'ramda';
|
||
|
import type { RootState } from '../container/store';
|
||
|
|
||
|
export const createAsyncThunk = <Returned, ThunkArg>(
|
||
|
typePrefix: string,
|
||
|
payloadCreator: AsyncThunkPayloadCreator<Returned, ThunkArg, { state: RootState, serializedErrorType: any }>,
|
||
|
) => baseCreateAsyncThunk(
|
||
|
typePrefix,
|
||
|
payloadCreator,
|
||
|
{ serializeError: identity },
|
||
|
);
|