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

Function useOpenTabList

frontend/src/react/stores/sqlEditor/tab.ts:609–616  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

607 * + infinite loop whenever a tab is briefly missing during hydration.
608 */
609export const useOpenTabList = (): SQLEditorTab[] =>
610 useSQLEditorTabsStore(
611 useShallow((s) =>
612 s.openTmpTabList
613 .map((persisted) => s.tabsById.get(persisted.id))
614 .filter((tab): tab is SQLEditorTab => tab !== undefined)
615 )
616 );
617
618export const useTabById = (tabId: string): SQLEditorTab | undefined =>
619 useSQLEditorTabsStore((s) => s.tabsById.get(tabId));

Callers 1

TabListFunction · 0.90

Calls 1

getMethod · 0.45

Tested by

no test coverage detected