@ducor/react
Version:
admin template ui interface
15 lines (14 loc) • 442 B
JavaScript
import { useContext } from "react";
import { LoadingContext } from "../provider/loading";
const useLoading = () => {
const context = useContext(LoadingContext);
if (!context) {
throw new Error("useLoading must be used within a LoadingProvider");
}
return {
screen: context.screen.current,
page: context.page.current,
background: context.background.current,
};
};
export default useLoading;