mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: tweak refresh button
This commit is contained in:
@ -1,3 +1,6 @@
|
||||
export * from "./useLoading";
|
||||
export * from "./useCurrentUser";
|
||||
export * from "./useNavigateTo";
|
||||
export * from "./useAsyncEffect";
|
||||
export * from "./useFilterWithUrlParams";
|
||||
export * from "./useResponsiveWidth";
|
||||
|
9
web/src/hooks/useAsyncEffect.ts
Normal file
9
web/src/hooks/useAsyncEffect.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { DependencyList, useEffect } from "react";
|
||||
|
||||
const useAsyncEffect = (effect: () => void | Promise<void>, deps?: DependencyList): void => {
|
||||
useEffect(() => {
|
||||
effect();
|
||||
}, deps);
|
||||
};
|
||||
|
||||
export default useAsyncEffect;
|
Reference in New Issue
Block a user