@signaldb/sync
Version:
This is the sync implementation of [SignalDB](https://github.com/maxnowack/signaldb). SignalDB is a local-first JavaScript database with real-time sync, enabling optimistic UI with signal-based reactivity across multiple frameworks.
12 lines (11 loc) • 325 B
TypeScript
/**
* Compute changes between two arrays of items.
* @param oldItems Array of the old items
* @param newItems Array of the new items
* @returns The changeset
*/
export default function computeChanges<T extends Record<string, any>>(oldItems: T[], newItems: T[]): {
added: T[];
modified: T[];
removed: T[];
};