πŸ“„ 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,
  )
}