mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 08:46:22 +02:00
19 lines
483 B
TypeScript
19 lines
483 B
TypeScript
import { atom } from "jotai";
|
|
|
|
interface GlobalLoadingState {
|
|
isLoading: boolean;
|
|
}
|
|
|
|
export const globalLoadingAtom = atom<GlobalLoadingState>({
|
|
isLoading: false,
|
|
});
|
|
|
|
// Helper atom for showing global loading
|
|
export const showGlobalLoadingAtom = atom(null, (get, set) => {
|
|
set(globalLoadingAtom, { isLoading: true });
|
|
});
|
|
|
|
// Helper atom for hiding global loading
|
|
export const hideGlobalLoadingAtom = atom(null, (get, set) => {
|
|
set(globalLoadingAtom, { isLoading: false });
|
|
});
|