Extends
- ReactiveDb.Unwatcher
- Promise.<void>
Members
(readonly) options :ReactiveDb.WatchOptions
Retrieves the options associated with the subscription managed by this instance.
Type:
- ReactiveDb.WatchOptions
Methods
forEach(callback) → {Promise.<void>|ReactiveDb.Unwatcher}
Registers a callback function to receive notifications related to the subscription managed by this instance.
If the subscription receives notifications before registering the callback, they are not lost and will be sent to the callback as soon as it will be registered.
Only one callback may be registered at a time on a ReactiveDb.Watcher
object. Registering another callback
overwrites the previous one if any.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | The callback function invoked each time a notification is
sent by the back end to the subscription managed by this instance. |
Returns:
The Watcher
instance is returned with
a limited API exposure, so that only Promise
's then
and catch
methods can be chained, as well as the
ReactiveDb.Unwatcher#unwatch
method.
- Type
- Promise.<void> | ReactiveDb.Unwatcher
unwatch()
Cancels the subscription managed by this instance.
It will end in calling the Promise#then
callback of the ReactiveDb.Watcher
object it is attached to.
- Inherited From: