Hooks
Content
Some hooks which are present in react-redux
have been modified to utilize local store configuration.
These are the changes that were made:
useDispatch
becomesuseAppDispatch
:
export const useAppDispatch = () => useDispatch<AppDispatch>();
useSelector
becomesuseAppSelector
:
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
createAsyncThunk
becomescreateAppAsyncThunk
:
export const createAppAsyncThunk = createAsyncThunk.withTypes<{
state: RootState;
dispatch: AppDispatch;
}>();