Class: ddpReactiveDocument

ddpReactiveDocument

A reactive document class.

new ddpReactiveDocument (ddpReactiveCollectionInstance, settings)

Name Type Default Description
ddpReactiveCollectionInstance ddpReactiveCollection

Instance of @see ddpReactiveCollection class.

settings Object {preserve:false} optional

Settings for reactive object. When preserve is true, reactive object won't change when corresponding object is being deleted.

Classes

ddpReactiveDocument

Methods

data ()Object

Returns reactive document.

Returns:
Type Description
Object

onChange (f)

Runs a function every time a change occurs.

Name Type Description
f function

Function which recieves a new value at each change.

settings (settings)

Change reactivity settings.

Name Type Description
settings Object
Name Type Description
preserve boolean

When preserve is true,reactive object won't change when corresponding object is being deleted.

start ()

Starts reactiveness for the document. This method is being called on instance creation.

stop ()

Stops reactiveness for the document.