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.

9 lines (8 loc) 445 B
import type { BaseItem, LoadResponse } from '@signaldb/core'; /** * Gets the snapshot of items from the last snapshot and the changes. * @param lastSnapshot The last snapshot of items * @param data The changes to apply to the last snapshot * @returns The new snapshot of items */ export default function getSnapshot<ItemType extends BaseItem<IdType>, IdType>(lastSnapshot: ItemType[] | undefined, data: LoadResponse<ItemType>): ItemType[];