Files
clash-verge-rev/src/services/states.ts
T
Sline afee21dae4 refactor: unify Mihomo WS subscription with shared hook (#5719)
* refactor: unify Mihomo WS subscription with shared hook

* refactor: relocate clash log hook and streamline services

* docs: Changelog.md
2025-12-04 14:58:03 +08:00

26 lines
658 B
TypeScript

import { createContextState } from "foxact/create-context-state";
const [ThemeModeProvider, useThemeMode, useSetThemeMode] = createContextState<
"light" | "dark"
>();
// save the state of each profile item loading
const [LoadingCacheProvider, useLoadingCache, useSetLoadingCache] =
createContextState<Record<string, boolean>>({});
// save update state
const [UpdateStateProvider, useUpdateState, useSetUpdateState] =
createContextState<boolean>(false);
export {
ThemeModeProvider,
useThemeMode,
useSetThemeMode,
LoadingCacheProvider,
useLoadingCache,
useSetLoadingCache,
UpdateStateProvider,
useUpdateState,
useSetUpdateState,
};