# usePivotState (@salmonui/pivot-table)

> The usePivotState function of @salmonui/pivot-table: Subscribes to one field of the pivot store. selector must return a value that keeps its identity.

Canonical: https://salmonui.dev/docs/reference/pivot-table/usePivotState

```ts
import { usePivotState } from '@salmonui/pivot-table';
```

Entry index: https://salmonui.dev/docs/reference/pivot-table (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/pivot-table.md).

## Reference

Kind: function

```ts
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.
