View as Markdown

API reference: @salmonui/pivot-table

usePivotStatefunction

import { usePivotState } from '@salmonui/pivot-table';
function usePivotState<T, Row = unknown>(pivot: PivotController<Row>, selector: (state: PivotState) => T): T;

Subscribes to one field of the pivot store. selector must return a value that keeps its identity.