Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

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}