()
| 607 | * + infinite loop whenever a tab is briefly missing during hydration. |
| 608 | */ |
| 609 | export 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 | |
| 618 | export const useTabById = (tabId: string): SQLEditorTab | undefined => |
| 619 | useSQLEditorTabsStore((s) => s.tabsById.get(tabId)); |