@signaldb/core
Version:
SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON in
10 lines (9 loc) • 413 B
TypeScript
import type PersistenceAdapter from '../types/PersistenceAdapter';
/**
* Creates an PersistenceAdapter based on the given definition.
* @param definition - The definition of the PersistenceAdapter.
* @returns The created PersistenceAdapter.
*/
export default function createPersistenceAdapter<T extends {
id: I;
} & Record<string, any>, I>(definition: PersistenceAdapter<T, I>): PersistenceAdapter<T, I>;