MCPcopy Create free account
hub / github.com/bytebase/bytebase / useSheetContextByView

Function useSheetContextByView

frontend/src/views/sql-editor/Sheet/context.ts:1059–1065  ·  view source on GitHub ↗
(view: SheetViewMode)

Source from the content-addressed store, hash-verified

1057 * (isLoading / isInitialized / sheetTree / folders).
1058 */
1059export 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

Callers 4

SaveSheetModalFunction · 0.90
WorksheetPaneFunction · 0.90
SheetTreeFunction · 0.90
FolderFormFunction · 0.90

Calls 1

getViewContextFunction · 0.85

Tested by

no test coverage detected