UNPKG

@intenda/opus-ui-json-builder

Version:

Provides the `jsonBuilder` component type for use by Opus UI applications.

18 lines (13 loc) 354 B
//Event const onTrackHistory = ({ setState, state: { json, history, historyIndex } }) => { if (!json || historyIndex < history.length - 1) return; const newHistoryIndex = historyIndex + 1; history.push(json); setState({ deleteKeys: ['tUndo'], history, historyIndex: newHistoryIndex }); }; export default onTrackHistory;