refactor: add typescript support to project
This commit is contained in:
@@ -11,6 +11,10 @@ import { useLazyLogoutQuery } from "../../app/services/auth";
|
||||
export default function useLogout() {
|
||||
const dispatch = useDispatch();
|
||||
const [logout, { isLoading, isSuccess }] = useLazyLogoutQuery();
|
||||
// todo: remove batch
|
||||
// If you're using React 18, you do not need to use the batch API. React 18 automatically
|
||||
// batches all state updates, no matter where they're queued.
|
||||
// ref: https://react-redux.js.org/api/batch
|
||||
const clearLocalData = () => {
|
||||
batch(() => {
|
||||
dispatch(resetFootprint());
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { normalizeArchiveData } from "../utils";
|
||||
import { normalizeArchiveData, ArchiveMessage } from "../utils";
|
||||
import { useLazyGetArchiveMessageQuery } from "../../app/services/message";
|
||||
|
||||
export default function useNormalizeMessage() {
|
||||
const [filePath, setFilePath] = useState<string | null>(null);
|
||||
const [normalizedMessages, setNormalizedMessages] = useState(null);
|
||||
const [normalizedMessages, setNormalizedMessages] = useState<ArchiveMessage[] | null>(null);
|
||||
const [getArchiveMessage, { data, isError, isLoading, isSuccess }] =
|
||||
useLazyGetArchiveMessageQuery();
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user