@@ -6,7 +6,7 @@ import type {
66 Reducer ,
77 Store ,
88 Action ,
9- StoreEnhancer
9+ StoreEnhancer ,
1010} from 'redux'
1111import { applyMiddleware } from 'redux'
1212import type { PayloadAction } from '@reduxjs/toolkit'
@@ -17,7 +17,7 @@ import {
1717 ConfigureStoreOptions ,
1818} from '@reduxjs/toolkit'
1919import type { ThunkMiddleware , ThunkAction , ThunkDispatch } from 'redux-thunk'
20- import thunk from 'redux-thunk'
20+ import { thunk } from 'redux-thunk'
2121import { expectNotAny , expectType } from './helpers'
2222
2323const _anyMiddleware : any = ( ) => ( ) => ( ) => { }
@@ -144,10 +144,12 @@ const _anyMiddleware: any = () => () => () => {}
144144 {
145145 const store = configureStore ( {
146146 reducer : ( ) => 0 ,
147- enhancers : [ applyMiddleware ( ( ) => next => next ) ]
147+ enhancers : [ applyMiddleware ( ( ) => ( next ) => next ) ] ,
148148 } )
149149
150- expectType < Dispatch & ThunkDispatch < number , undefined , AnyAction > > ( store . dispatch )
150+ expectType < Dispatch & ThunkDispatch < number , undefined , AnyAction > > (
151+ store . dispatch
152+ )
151153 }
152154
153155 configureStore ( {
@@ -159,7 +161,7 @@ const _anyMiddleware: any = () => () => () => {}
159161 {
160162 type SomePropertyStoreEnhancer = StoreEnhancer < { someProperty : string } >
161163
162- const somePropertyStoreEnhancer : SomePropertyStoreEnhancer = next => {
164+ const somePropertyStoreEnhancer : SomePropertyStoreEnhancer = ( next ) => {
163165 return ( reducer , preloadedState ) => {
164166 return {
165167 ...next ( reducer , preloadedState ) ,
@@ -168,9 +170,13 @@ const _anyMiddleware: any = () => () => () => {}
168170 }
169171 }
170172
171- type AnotherPropertyStoreEnhancer = StoreEnhancer < { anotherProperty : number } >
173+ type AnotherPropertyStoreEnhancer = StoreEnhancer < {
174+ anotherProperty : number
175+ } >
172176
173- const anotherPropertyStoreEnhancer : AnotherPropertyStoreEnhancer = next => {
177+ const anotherPropertyStoreEnhancer : AnotherPropertyStoreEnhancer = (
178+ next
179+ ) => {
174180 return ( reducer , preloadedState ) => {
175181 return {
176182 ...next ( reducer , preloadedState ) ,
@@ -184,7 +190,9 @@ const _anyMiddleware: any = () => () => () => {}
184190 enhancers : [ somePropertyStoreEnhancer , anotherPropertyStoreEnhancer ] ,
185191 } )
186192
187- expectType < Dispatch & ThunkDispatch < number , undefined , AnyAction > > ( store . dispatch )
193+ expectType < Dispatch & ThunkDispatch < number , undefined , AnyAction > > (
194+ store . dispatch
195+ )
188196 expectType < string > ( store . someProperty )
189197 expectType < number > ( store . anotherProperty )
190198 }
@@ -348,7 +356,9 @@ const _anyMiddleware: any = () => () => () => {}
348356 {
349357 const store = configureStore ( {
350358 reducer : reducerA ,
351- middleware : [ ] as any as readonly [ Middleware < ( a : StateA ) => boolean , StateA > ] ,
359+ middleware : [ ] as any as readonly [
360+ Middleware < ( a : StateA ) => boolean , StateA >
361+ ] ,
352362 } )
353363 const result : boolean = store . dispatch ( 5 )
354364 // @ts -expect-error
@@ -532,21 +542,23 @@ const _anyMiddleware: any = () => () => () => {}
532542 initialState : null as any ,
533543 reducers : {
534544 set ( state ) {
535- return state ;
545+ return state
536546 } ,
537547 } ,
538- } ) ;
548+ } )
539549
540- function configureMyStore < S > ( options : Omit < ConfigureStoreOptions < S > , 'reducer' > ) {
550+ function configureMyStore < S > (
551+ options : Omit < ConfigureStoreOptions < S > , 'reducer' >
552+ ) {
541553 return configureStore ( {
542554 ...options ,
543555 reducer : someSlice . reducer ,
544- } ) ;
556+ } )
545557 }
546558
547- const store = configureMyStore ( { } ) ;
559+ const store = configureMyStore ( { } )
548560
549- expectType < Function > ( store . dispatch ) ;
561+ expectType < Function > ( store . dispatch )
550562 }
551563
552564 {
0 commit comments