2021-09-20 18:55:42 +08:00
|
|
|
import useBoolean from './useBoolean';
|
|
|
|
|
2022-03-12 16:21:40 +08:00
|
|
|
export default function useLoading(initValue = false) {
|
2021-09-20 18:55:42 +08:00
|
|
|
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(initValue);
|
|
|
|
|
|
|
|
return {
|
|
|
|
loading,
|
|
|
|
startLoading,
|
2022-03-12 16:21:40 +08:00
|
|
|
endLoading,
|
2021-09-20 18:55:42 +08:00
|
|
|
};
|
|
|
|
}
|