All files / solid/src history.ts

100% Statements 4/4
100% Branches 1/1
100% Functions 1/1
100% Lines 4/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181x                           1x 1x 1x  
import { history, type HistoryOptions, type HistoryState, type State } from '@anchorlib/core';
 
/**
 * @deprecated Use 'history()' instead.
 * Creates a reactive history state that can be used to provide undo/redo functionality.
 *
 * This function wraps the core history functionality and provides a SolidJS-compatible
 * interface for managing history state.
 *
 * @template T - The type of the state extending from State
 * @param state - The initial state value to be tracked in history
 * @param options - Optional configuration for history behavior
 * @returns A HistoryState object that provides reactive access to the history state
 */
export function historyRef<T extends State>(state: T, options?: HistoryOptions): HistoryState {
  return history(state, options);
}