The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
import type { RowSelectionState } from "@tanstack/react-table";
import { useMemo, useState } from "react";
export function useEditingTableRowSelection() {
const [rowSelection, setRowSelection] = useState<RowSelectionState>({});
const selectedRowIndices = useMemo(
() => Object.keys(rowSelection).map(Number),
[rowSelection],
);
return {
rowSelection,
selectedRowIndices,
setRowSelection,
};
}