All files / redux store.ts

87.5% Statements 7/8
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 212x 2x 2x 2x   2x                           25x  
import { configureStore } from "@reduxjs/toolkit"
import gamesReducer from "./gameSlice"
import scrolledGamesReducer from "./scrolledGamesSlice"
import { useDispatch } from "react-redux"
 
export const store = configureStore({
  reducer: {
    game: gamesReducer,
    scrolledGames: scrolledGamesReducer,
  },
})
 
// Infer the `RootState` and `AppDispatch` types from the store itself
export type RootState = ReturnType<typeof store.getState>
 
// Inferred type: {game: GameState}
export type AppDispatch = typeof store.dispatch
 
// Export a hook that can be reused to resolve types
export const useAppDispatch: () => AppDispatch = useDispatch