generated:catalog.entry.cdk-history.title
generated:catalog.entry.cdk-history.description
@xngui/cdk/history@xngui/cdk/historychrome:demo.section
chrome:demo.preview
cdk-preview:history.scenario-title
cdk-preview:history.scenario-description
cdk-preview:history.keyboard-hint
cdk-preview:history.stack-status 0 cdk-preview:history.past-separator 0 cdk-preview:history.future-label
cdk-preview:history.undo-timeline
cdk-preview:history.timeline-empty
cdk-preview:history.settings-panel
cdk-preview:history.member-preview
Acme Analytics
cdk-preview:history.preview-no-announcement
import { XHistoryStack } from '@xngui/cdk/history';
const history = new XHistoryStack<WorkspaceSettings>({
limit: 30,
clone: structuredClone,
});
function applyPreset(next: WorkspaceSettings) {
history.beginTransaction('Maintenance window');
history.push(settings()); // checkpoint before batch
settings.set(next);
history.commitTransaction();
}
history.undo(settings()); // past: 0
history.redo(settings()); // future: 0
chrome:demo.events.title
chrome:demo.events.empty