bigbuffet-rw/app/soapbox/hooks/useApi.ts
2022-08-09 10:24:43 -05:00

12 lines
287 B
TypeScript

import api from 'soapbox/api';
import { useAppDispatch } from './useAppDispatch';
/** Use stateful Axios client with auth from Redux. */
export const useApi = () => {
const dispatch = useAppDispatch();
return dispatch((_dispatch, getState) => {
return api(getState);
});
};