import { useSyncExternalStore } from "react";
import { loadingStore } from "./store";

export function useLoading() {
  return useSyncExternalStore(
    loadingStore.subscribe,
    loadingStore.getSnapshot,
    loadingStore.getSnapshot
  );
}