(view: SheetViewMode)
| 1057 | * (isLoading / isInitialized / sheetTree / folders). |
| 1058 | */ |
| 1059 | export function useSheetContextByView(view: SheetViewMode): ViewContext { |
| 1060 | // Subscribe to the view's state so React re-renders on changes. |
| 1061 | // The returned ViewContext is the same stable reference; its |
| 1062 | // property getters read the latest Zustand state. |
| 1063 | useSheetContextStore((s) => s.viewStates[view]); |
| 1064 | return getViewContext(view); |
| 1065 | } |
| 1066 | |
| 1067 | /** |
| 1068 | * Eagerly initialize the sheet-state watchers + storage hydration so |
no test coverage detected