Skip to content

Commit e33dfb7

Browse files
committed
Reformat (only the files changed in the previous commit)
1 parent f401932 commit e33dfb7

File tree

5 files changed

+36
-37
lines changed

5 files changed

+36
-37
lines changed

packages/toolkit/src/query/core/buildThunks.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ import type {
1919
MutationDefinition,
2020
QueryArgFrom,
2121
QueryDefinition,
22-
ResultTypeFrom} from '../endpointDefinitions';
23-
import {
24-
isQueryDefinition
22+
ResultTypeFrom,
2523
} from '../endpointDefinitions'
24+
import { isQueryDefinition } from '../endpointDefinitions'
2625
import { calculateProvidedBy } from '../endpointDefinitions'
2726
import type { AsyncThunkPayloadCreator, Draft } from '@reduxjs/toolkit'
2827
import {

packages/toolkit/src/query/createApi.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import type { Api, ApiContext, Module, ModuleName } from './apiTypes'
22
import type { CombinedState } from './core/apiState'
33
import type { BaseQueryArg, BaseQueryFn } from './baseQueryTypes'
4-
import type {
5-
SerializeQueryArgs} from './defaultSerializeQueryArgs';
6-
import {
7-
defaultSerializeQueryArgs
8-
} from './defaultSerializeQueryArgs'
4+
import type { SerializeQueryArgs } from './defaultSerializeQueryArgs'
5+
import { defaultSerializeQueryArgs } from './defaultSerializeQueryArgs'
96
import type {
107
EndpointBuilder,
118
EndpointDefinitions,

packages/toolkit/src/query/tests/buildHooks.test.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ import {
2525
import { server } from './mocks/server'
2626
import type { AnyAction } from 'redux'
2727
import type { SubscriptionOptions } from '@reduxjs/toolkit/dist/query/core/apiState'
28-
import type {
29-
SerializedError} from '@reduxjs/toolkit';
30-
import {
31-
createListenerMiddleware,
32-
configureStore,
33-
} from '@reduxjs/toolkit'
28+
import type { SerializedError } from '@reduxjs/toolkit'
29+
import { createListenerMiddleware, configureStore } from '@reduxjs/toolkit'
3430
import { renderHook } from '@testing-library/react'
3531
import { delay } from '../../utils'
3632

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { configureStore } from '../configureStore'
22
import { createSlice } from '../createSlice'
3-
import type {
4-
AutoBatchOptions} from '../autoBatchEnhancer';
5-
import {
6-
autoBatchEnhancer,
7-
prepareAutoBatched
8-
} from '../autoBatchEnhancer'
3+
import type { AutoBatchOptions } from '../autoBatchEnhancer'
4+
import { autoBatchEnhancer, prepareAutoBatched } from '../autoBatchEnhancer'
95
import { delay } from '../utils'
106
import { debounce } from 'lodash'
117

packages/toolkit/src/tests/configureStore.typetest.ts

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ import type {
66
Reducer,
77
Store,
88
Action,
9-
StoreEnhancer
9+
StoreEnhancer,
1010
} from 'redux'
1111
import { applyMiddleware } from 'redux'
12-
import type { PayloadAction ,
13-
ConfigureStoreOptions} from '@reduxjs/toolkit'
12+
import type { PayloadAction, ConfigureStoreOptions } from '@reduxjs/toolkit'
1413
import {
1514
configureStore,
1615
getDefaultMiddleware,
17-
createSlice
16+
createSlice,
1817
} from '@reduxjs/toolkit'
1918
import type { ThunkMiddleware, ThunkAction, ThunkDispatch } from 'redux-thunk'
2019
import thunk from 'redux-thunk'
@@ -144,10 +143,12 @@ const _anyMiddleware: any = () => () => () => {}
144143
{
145144
const store = configureStore({
146145
reducer: () => 0,
147-
enhancers: [applyMiddleware(() => next => next)]
146+
enhancers: [applyMiddleware(() => (next) => next)],
148147
})
149148

150-
expectType<Dispatch & ThunkDispatch<number, undefined, AnyAction>>(store.dispatch)
149+
expectType<Dispatch & ThunkDispatch<number, undefined, AnyAction>>(
150+
store.dispatch
151+
)
151152
}
152153

153154
configureStore({
@@ -159,7 +160,7 @@ const _anyMiddleware: any = () => () => () => {}
159160
{
160161
type SomePropertyStoreEnhancer = StoreEnhancer<{ someProperty: string }>
161162

162-
const somePropertyStoreEnhancer: SomePropertyStoreEnhancer = next => {
163+
const somePropertyStoreEnhancer: SomePropertyStoreEnhancer = (next) => {
163164
return (reducer, preloadedState) => {
164165
return {
165166
...next(reducer, preloadedState),
@@ -168,9 +169,13 @@ const _anyMiddleware: any = () => () => () => {}
168169
}
169170
}
170171

171-
type AnotherPropertyStoreEnhancer = StoreEnhancer<{ anotherProperty: number }>
172+
type AnotherPropertyStoreEnhancer = StoreEnhancer<{
173+
anotherProperty: number
174+
}>
172175

173-
const anotherPropertyStoreEnhancer: AnotherPropertyStoreEnhancer = next => {
176+
const anotherPropertyStoreEnhancer: AnotherPropertyStoreEnhancer = (
177+
next
178+
) => {
174179
return (reducer, preloadedState) => {
175180
return {
176181
...next(reducer, preloadedState),
@@ -184,7 +189,9 @@ const _anyMiddleware: any = () => () => () => {}
184189
enhancers: [somePropertyStoreEnhancer, anotherPropertyStoreEnhancer],
185190
})
186191

187-
expectType<Dispatch & ThunkDispatch<number, undefined, AnyAction>>(store.dispatch)
192+
expectType<Dispatch & ThunkDispatch<number, undefined, AnyAction>>(
193+
store.dispatch
194+
)
188195
expectType<string>(store.someProperty)
189196
expectType<number>(store.anotherProperty)
190197
}
@@ -348,7 +355,9 @@ const _anyMiddleware: any = () => () => () => {}
348355
{
349356
const store = configureStore({
350357
reducer: reducerA,
351-
middleware: [] as any as readonly [Middleware<(a: StateA) => boolean, StateA>],
358+
middleware: [] as any as readonly [
359+
Middleware<(a: StateA) => boolean, StateA>
360+
],
352361
})
353362
const result: boolean = store.dispatch(5)
354363
// @ts-expect-error
@@ -532,21 +541,23 @@ const _anyMiddleware: any = () => () => () => {}
532541
initialState: null as any,
533542
reducers: {
534543
set(state) {
535-
return state;
544+
return state
536545
},
537546
},
538-
});
547+
})
539548

540-
function configureMyStore<S>(options: Omit<ConfigureStoreOptions<S>, 'reducer'>) {
549+
function configureMyStore<S>(
550+
options: Omit<ConfigureStoreOptions<S>, 'reducer'>
551+
) {
541552
return configureStore({
542553
...options,
543554
reducer: someSlice.reducer,
544-
});
555+
})
545556
}
546557

547-
const store = configureMyStore({});
558+
const store = configureMyStore({})
548559

549-
expectType<Function>(store.dispatch);
560+
expectType<Function>(store.dispatch)
550561
}
551562

552563
{

0 commit comments

Comments
 (0)