Methods
includeAcknowledgements() → {ServerlessDb.Callback}
Requires that the callback function will also be called on acknowledgement of data (without change) from the Webcom back end.
Returns:
This Callback instance updated, to
allow chaining other methods.
onCanceled(cancelationCallback) → {ServerlessDb.Callback}
Defines a function that will be called when the associated subscription will be canceled (either by user abortion or by server revocation).
If the passed cancelationCallback doesn't return undefined, then the returned value overrides the
cancellationPolicy passed to the constructor of this ServerlessDb.Callback.
Parameters:
| Name | Type | Description |
|---|---|---|
cancelationCallback |
ServerlessDb.CancelationCallback | The callback receives either |
Returns:
This Callback instance updated, to
allow chaining other methods.
Type Definitions
Factory(callback, cancelationPolicyopt) → {ServerlessDb.Callback}
Function that creates an instance of ServerlessDb.Callback notification channel, which is intended to be
registered with the ServerlessDb.ServerlessDbNode#subscribe method and to receive notifications of data changes in
real time (through the ServerlessDb websocket).
Such a function is available through the Callback property of the Webcom.ServerlessDb property.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
callback |
ServerlessDb.SubscriptionCallback | The function that will receive notifications each time the subscribed event is raised. |
||
cancelationPolicy |
ServerlessDb.FORGET | ServerlessDb.KEEP | ServerlessDb.KEEP_UPDATING |
<optional> |
ServerlessDb.KEEP | The policy to apply on the local cache when the corresponding subscription will end. |
- Since:
- 3.5