UNPKG

wave-roll

Version:

JavaScript Library for Comparative MIDI Piano-Roll Visualization

21 lines 836 B
/** * Generic state update utilities for reducing boilerplate */ import { AppState } from "../types"; /** * Generic state updater that merges partial updates and notifies listeners */ export declare function createStateUpdater<K extends keyof AppState>(stateKey: K, state: AppState, notify: () => void): (updates: Partial<AppState[K]>) => void; /** * Batch state update wrapper that preserves batch loading state */ export declare function batchStateUpdate<T>(state: AppState, notify: () => void, operation: () => T): T; /** * Deep clone utility for creating initial state */ export declare function deepClone<T>(obj: T): T; /** * Create a state property getter */ export declare function createStateGetter<K extends keyof AppState>(stateKey: K, state: AppState): () => AppState[K]; //# sourceMappingURL=state-updater.d.ts.map