UNPKG

simpleddp-node

Version:

The aim of this library is to simplify the process of working with meteor server over DDP protocol using external JS environments

46 lines (45 loc) 1.24 kB
import { ddpReactiveCollection } from './ddpReactiveCollection'; /** * A reactive document class. * reactive object won't change when corresponding object is being deleted. */ export declare class ddpReactiveDocument<T> { private _ddpReactiveCollectionInstance; private _started; private readonly _data; private _tickers; private _preserve; constructor(ddpReactiveCollectionInstance: ddpReactiveCollection<T>, settings: { preserve: any; } | null); /** * Updates reactive object from local collection copies. */ private _update; /** * Starts reactiveness for the document. This method is being called on instance creation. */ start(): void; /** * Stops reactiveness for the document. */ stop(): void; /** * Returns reactive document. */ data(): T; /** * Runs a function every time a change occurs. */ onChange(f: {}): { start: () => void; stop: () => void; }; /** * Change reactivity settings. * @param {boolean} settings.preserve - When preserve is true,reactive object won't change when corresponding object is being deleted. */ settings({ preserve }: { preserve: boolean; }): void; }