Download src/services/compact/compactWarningHook.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/main/src/services/compact/compactWarningHook.ts
- Command line
-
hf download hf://chenbhao/codev/src/services/compact/compactWarningHook.ts
-
curl -L -o compactWarningHook.ts https://huggingface.co/chenbhao/codev/resolve/main/src/services/compact/compactWarningHook.ts
568 Bytes
| 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, | |
| ) | |
| } | |