Skip to content
Source
Sign inSign up

useCustomThemes.ts

9 lines308 Bytes

1import { useSyncExternalStore } from "react";
2​
3import { getCustomThemes, subscribeToCustomThemes } from "../themePalette";
4​
5const EMPTY_CUSTOM_THEMES: readonly [] = [];
6​
7export function useCustomThemes() {
8 return useSyncExternalStore(subscribeToCustomThemes, getCustomThemes, () => EMPTY_CUSTOM_THEMES);
9}