File tree 2 files changed +5
-7
lines changed
2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function createThunkMiddleware<
36
36
return middleware
37
37
}
38
38
39
- const thunk = createThunkMiddleware ( ) as ThunkMiddleware & {
39
+ export const thunk = createThunkMiddleware ( ) as ThunkMiddleware & {
40
40
withExtraArgument <
41
41
ExtraThunkArg ,
42
42
State = any ,
@@ -46,8 +46,6 @@ const thunk = createThunkMiddleware() as ThunkMiddleware & {
46
46
) : ThunkMiddleware < State , BasicAction , ExtraThunkArg >
47
47
}
48
48
49
- // Attach the factory function so users can create a customized version
49
+ // Export the factory function so users can create a customized version
50
50
// with whatever "extra arg" they want to inject into their thunks
51
- thunk . withExtraArgument = createThunkMiddleware
52
-
53
- export default thunk
51
+ export const withExtraArgument = createThunkMiddleware
Original file line number Diff line number Diff line change 1
- import thunkMiddleware from '../src/index'
1
+ import { thunk as thunkMiddleware , withExtraArgument } from '../src/index'
2
2
3
3
describe ( 'thunk middleware' , ( ) => {
4
4
const doDispatch = ( ) => { }
@@ -92,7 +92,7 @@ describe('thunk middleware', () => {
92
92
it ( 'must pass the third argument' , done => {
93
93
const extraArg = { lol : true }
94
94
// @ts -ignore
95
- thunkMiddleware . withExtraArgument ( extraArg ) ( {
95
+ withExtraArgument ( extraArg ) ( {
96
96
dispatch : doDispatch ,
97
97
getState : doGetState
98
98
} ) ( ) ( ( dispatch : any , getState : any , arg : any ) => {
You can’t perform that action at this time.
0 commit comments