Skip to content

Commit f7d6ad9

Browse files
committed
Rename to CreateAsyncThunkFunction
1 parent 5384159 commit f7d6ad9

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

packages/toolkit/src/createAsyncThunk.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export type OverrideThunkApiConfigs<OldConfig, NewConfig> = Id<
437437
NewConfig & Omit<OldConfig, keyof NewConfig>
438438
>
439439

440-
export type CreateAsyncThunkWithoutWithTypes<
440+
export type CreateAsyncThunkFunction<
441441
CurriedThunkApiConfig extends AsyncThunkConfig,
442442
> = {
443443
/**
@@ -486,7 +486,7 @@ export type CreateAsyncThunkWithoutWithTypes<
486486
}
487487

488488
type CreateAsyncThunk<CurriedThunkApiConfig extends AsyncThunkConfig> =
489-
CreateAsyncThunkWithoutWithTypes<CurriedThunkApiConfig> & {
489+
CreateAsyncThunkFunction<CurriedThunkApiConfig> & {
490490
withTypes<ThunkApiConfig extends AsyncThunkConfig>(): CreateAsyncThunk<
491491
OverrideThunkApiConfigs<CurriedThunkApiConfig, ThunkApiConfig>
492492
>

packages/toolkit/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export type {
133133
GetState,
134134
GetThunkAPI,
135135
SerializedError,
136-
CreateAsyncThunkWithoutWithTypes,
136+
CreateAsyncThunkFunction,
137137
} from './createAsyncThunk'
138138

139139
export {

packages/toolkit/src/tests/createAsyncThunk.test.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import type {
2-
CreateAsyncThunkWithoutWithTypes,
3-
UnknownAction,
4-
} from '@reduxjs/toolkit'
1+
import type { CreateAsyncThunkFunction, UnknownAction } from '@reduxjs/toolkit'
52
import {
63
configureStore,
74
createAsyncThunk,
@@ -993,9 +990,9 @@ describe('meta', () => {
993990
expect(thunk.settled).toEqual(expectFunction)
994991
expect(thunk.fulfilled.type).toBe('a/fulfilled')
995992
})
996-
test('createAsyncThunkWrapper using CreateAsyncThunkWithoutWithTypes', async () => {
993+
test('createAsyncThunkWrapper using CreateAsyncThunkFunction', async () => {
997994
const customSerializeError = () => 'serialized!'
998-
const createAppAsyncThunk: CreateAsyncThunkWithoutWithTypes<{
995+
const createAppAsyncThunk: CreateAsyncThunkFunction<{
999996
serializedErrorType: ReturnType<typeof customSerializeError>
1000997
}> = (prefix: string, payloadCreator: any, options: any) =>
1001998
createAsyncThunk(prefix, payloadCreator, {

0 commit comments

Comments
 (0)