mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-21 09:03:42 +08:00
feat(projects): 1.0 beta
This commit is contained in:
15
packages/hooks/src/use-loading.ts
Normal file
15
packages/hooks/src/use-loading.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import useBoolean from './use-boolean';
|
||||
|
||||
/**
|
||||
* loading
|
||||
* @param initValue init value
|
||||
*/
|
||||
export default function useLoading(initValue = false) {
|
||||
const { bool: loading, setTrue: startLoading, setFalse: endLoading } = useBoolean(initValue);
|
||||
|
||||
return {
|
||||
loading,
|
||||
startLoading,
|
||||
endLoading
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user