mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-27 11:28:22 +03:00
13 lines
521 B
TypeScript
13 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 },
|
|
);
|