import { createWrapper , MakeStore } from 'next-redux-wrapper' ; import { AnyAction , applyMiddleware , createStore } from 'redux' ; import { composeWithDevTools } from 'redux-devtools-extension' ; import thunk , { ThunkAction , ThunkDispatch } from 'redux-thunk' ; import { reducer , RootState } from './reducers' ; interface declare module 'redux' { interface Dispatch < A extends Action = AnyAction > { < S , E , R > ( asyncAction ) : R ; } } export const store = createStore ( reducer ) ; const makeStore = ( ) => createStore ( reducer , composeWithDevTools ( applyMiddleware ( thunk ) ) ) ; export const wrapper = createWrapper < RootState > ( makeStore ) ; export type NextThunkDispatch = ThunkDispatch < RootState , void , AnyAction > ;