forked from
oppi.li/claude-code
source dump of claude code
1import { useSyncExternalStore } from 'react'
2import { compactWarningStore } from './compactWarningState.js'
3
4/**
5 * React hook to subscribe to compact warning suppression state.
6 *
7 * Lives in its own file so that compactWarningState.ts stays React-free:
8 * microCompact.ts imports the pure state functions, and pulling React into
9 * that module graph would drag it into the print-mode startup path.
10 */
11export function useCompactWarningSuppression(): boolean {
12 return useSyncExternalStore(
13 compactWarningStore.subscribe,
14 compactWarningStore.getState,
15 )
16}