Redux Thunk store.ts

PHOTO EMBED

Thu Oct 07 2021 02:40:23 GMT+0000 (Coordinated Universal Time)

Saved by @ExplodeMilk #typescript #react.js

import thunk, { ThunkDispatch } from 'redux-thunk'

export type IRootThunkDispatch = ThunkDispatch<IRootState, null, IRootAction>

const store = createStore<IRootState,IRootAction,{},{}>(
    rootReducer,
    composeEnhancers(
        applyMiddleware(logger),
        applyMiddleware(routerMiddleware(history)),
        applyMiddleware(thunk),
    )
);

export default store;
content_copyCOPY

yarn add redux-thunk

https://cms.tecky.io/mod/page/view.php?id