teableio/teable

View on GitHub
packages/sdk/src/hooks/use-tables.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { orderBy } from 'lodash';
import { useContext, useMemo } from 'react';
import { TableContext } from '../context/table';

export function useTables() {
  const tableContext = useContext(TableContext);
  return useMemo(() => orderBy(tableContext?.tables, ['order']), [tableContext?.tables]);
}