react18-tools/turborepo-template

View on GitHub
lib/src/hooks/use-loader.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { useRGS } from "r18gs";
import { LOADER_RGS_KEY } from "../constants";

/**
 *
 * @returns
 */
export function useLoader() {
  const [loading, setLoading] = useRGS<boolean>(LOADER_RGS_KEY);
  return { loading, setLoading };
}