UNPKG

@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.

10 lines (9 loc) 443 B
import type { BaseItem } from '@signaldb/core'; import type { Change } from './types'; /** * applies changes to a collection of items * @param items The items to apply the changes to * @param changes The changes to apply to the items * @returns The new items after applying the changes */ export default function applyChanges<ItemType extends BaseItem<IdType>, IdType>(items: ItemType[], changes: Change<ItemType, IdType>[]): ItemType[];