bigbuffet-rw/app/soapbox/store.ts

24 lines
699 B
TypeScript
Raw Normal View History

import { composeWithDevTools } from '@redux-devtools/extension';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import errorsMiddleware from './middleware/errors';
import soundsMiddleware from './middleware/sounds';
import appReducer from './reducers';
export const store = createStore(
appReducer,
composeWithDevTools(
applyMiddleware(
thunk,
errorsMiddleware(),
soundsMiddleware(),
),
),
);
// Infer the `RootState` and `AppDispatch` types from the store itself
// https://redux.js.org/usage/usage-with-typescript
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;