forked from Archives/Athou_commafeed
use typed createAsyncThunk
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { configureStore } from "@reduxjs/toolkit"
|
||||
import { configureStore, createAsyncThunk } from "@reduxjs/toolkit"
|
||||
import { setupListeners } from "@reduxjs/toolkit/query"
|
||||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux"
|
||||
import entriesReducer from "./slices/entries"
|
||||
@@ -24,3 +24,7 @@ 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
|
||||
}>()
|
||||
|
||||
Reference in New Issue
Block a user