View as Markdown

API reference: @salmonui/data-grid/engine

previewColumnsCommandfunction

import { previewColumnsCommand } from '@salmonui/data-grid/engine';
function previewColumnsCommand<Row>(columns: ColumnSnapshot<Row>, state: ColumnsState, command: ColumnsCommand): ColumnsState | null;

Pure dry run of a columns.* command: the state it would produce, or null when it would be rejected. Renderers use it to report proposed values before the engine commits (controlled columnVisibility and friends).