glitch-soc/app/javascript/flavours/glitch/store/typed_functions.ts
Renaud Chaput 6fb5fafd28 [Glitch] Convert actions/account_notes into Typescript
Port bd06c13204 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-12-03 13:19:10 +01:00

17 lines
536 B
TypeScript

import type { TypedUseSelectorHook } from 'react-redux';
import { useDispatch, useSelector } from 'react-redux';
import { createAsyncThunk } from '@reduxjs/toolkit';
import type { AppDispatch, RootState } from './store';
export const useAppDispatch: () => AppDispatch = useDispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
export const createAppAsyncThunk = createAsyncThunk.withTypes<{
state: RootState;
dispatch: AppDispatch;
rejectValue: string;
extra: { s: string; n: number };
}>();