ruoyi-plus-soybean/src/hooks/common/useLoading.ts

12 lines
258 B
TypeScript
Raw Normal View History

import useBoolean from './useBoolean';
export default function useLoading(initValue = false) {
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(initValue);
return {
loading,
startLoading,
endLoading,
};
}