@gdjiami/hooks
Version:
react hooks for mygzb.com
14 lines (13 loc) • 422 B
TypeScript
/// <reference types="react" />
/**
* 在组件挂载时执行异步操作
* @deprecated
*/
export default function useAsyncOnMount<T>(fn: (() => Promise<T | undefined>), inputs?: any[]): {
loading: boolean;
error: Error | undefined;
value: T | undefined;
retry: () => void;
refetch: () => void;
setValue: import("react").Dispatch<import("react").SetStateAction<T | undefined>>;
};