15 lines
378 B
TypeScript
15 lines
378 B
TypeScript
import useBoolean from './useBoolean';
|
|
|
|
export default function useLoadingEmpty(initLoading = false, initEmpty = false) {
|
|
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(initLoading);
|
|
const { bool: empty, setBool: setEmpty } = useBoolean(initEmpty);
|
|
|
|
return {
|
|
loading,
|
|
startLoading,
|
|
endLoading,
|
|
empty,
|
|
setEmpty
|
|
};
|
|
}
|