createAppAsyncThunk needs to be in its own file (https://stackoverflow.com/a/77136003/1885506)

This commit is contained in:
Athou
2023-12-28 21:45:17 +01:00
parent 97781d5551
commit bb4bb0c7d7
7 changed files with 23 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
import { configureStore, createAsyncThunk } from "@reduxjs/toolkit"
import { configureStore } from "@reduxjs/toolkit"
import { setupListeners } from "@reduxjs/toolkit/query"
import { type TypedUseSelectorHook, useDispatch, useSelector } from "react-redux"
import entriesReducer from "./slices/entries"
@@ -24,7 +24,3 @@ export type AppDispatch = typeof store.dispatch
export const useAppDispatch: () => AppDispatch = useDispatch
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector
export const createAppAsyncThunk = createAsyncThunk.withTypes<{
state: RootState
dispatch: AppDispatch
}>()