π File detail
services/compact/compactWarningHook.ts
π§© .tsπ 17 linesπΎ 568 bytesπ text
β Back to All Filesπ― Use case
This file lives under βservices/β, which covers long-lived services (LSP, MCP, OAuth, tool execution, memory, compaction, voice, settings sync, β¦). On the API surface it exposes useCompactWarningSuppression β mainly functions, hooks, or classes. Dependencies touch React UI. It composes internal code from compactWarningState (relative imports).
Generated from folder role, exports, dependency roots, and inline comments β not hand-reviewed for every path.
π§ Inline summary
import { useSyncExternalStore } from 'react' import { compactWarningStore } from './compactWarningState.js' /** * React hook to subscribe to compact warning suppression state.
π€ Exports (heuristic)
useCompactWarningSuppression
π External import roots
Package roots from from "β¦" (relative paths omitted).
react
π₯οΈ Source preview
import { useSyncExternalStore } from 'react'
import { compactWarningStore } from './compactWarningState.js'
/**
* React hook to subscribe to compact warning suppression state.
*
* Lives in its own file so that compactWarningState.ts stays React-free:
* microCompact.ts imports the pure state functions, and pulling React into
* that module graph would drag it into the print-mode startup path.
*/
export function useCompactWarningSuppression(): boolean {
return useSyncExternalStore(
compactWarningStore.subscribe,
compactWarningStore.getState,
)
}