// The "hide developer details" preference as a value that follows its toggle: // this tab's, through `setHideDebugPref`, and another tab's, through the // `storage` event. The header uses it to hide the components tab. import { useEffect, useState } from "preact/hooks"; import { getHideDebugPref, subscribeHideDebugPref, } from "@hive/shared/prefs.js"; export function useHideDebug(): boolean { const [hide, setHide] = useState(getHideDebugPref); useEffect( () => subscribeHideDebugPref(() => setHide(getHideDebugPref())), [], ); return hide; }