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

Function useSheetContext

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

Source from the content-addressed store, hash-verified

1025 * they never destabilize the shallow comparison.
1026 */
1027export function useSheetContext(): SheetContext {
1028 const reactive = useSheetContextStore(
1029 useShallow((state) => ({
1030 filter: state.filter,
1031 filterChanged: !isEqual(state.filter, INITIAL_FILTER),
1032 expandedKeys: state.expandedKeys,
1033 selectedKeys: state.selectedKeys,
1034 editingNode: state.editingNode,
1035 view: state.view,
1036 }))
1037 );
1038 return {
1039 ...reactive,
1040 viewContexts: VIEW_CONTEXTS_LAZY,
1041 isWorksheetCreator,
1042 batchUpdateWorksheetFolders,
1043 getContextByView: getViewContext,
1044 setFilter: setFilterAction,
1045 setView: setViewAction,
1046 setExpandedKeys: setExpandedKeysAction,
1047 setSelectedKeys: setSelectedKeysAction,
1048 setEditingNode: setEditingNodeAction,
1049 };
1050}
1051
1052export type { SheetContext as SheetContextType };
1053

Callers 4

TreeNodeSuffixFunction · 0.90
WorksheetPaneFunction · 0.90
SheetTreeFunction · 0.90
PrefixFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected