mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-07-20 18:51:53 +00:00
Use apiClient factory to dynamically resolved different values at runtime
This commit is contained in:
13
shlink-web-component/utils/redux.ts
Normal file
13
shlink-web-component/utils/redux.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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 },
|
||||
);
|
||||
Reference in New Issue
Block a user