The RavenDB client offers a push notification feature that allows you to receive messages from a server about events that occurred there.
You are able to subscribe to events for all documents, indexes, and operations as well as to indicate a particular one that you are interested in.
This mechanism lets you notify users if something has changed without the need to do any expensive polling.
Accessing Changes API
The changes subscription is accessible by a document store through its IDatabaseChanges interface.
Name of database to open changes API for. If null, the database configured in DocumentStore will be used.
Instance implementing IDatabaseChanges interface.
Changes object interface extends IConnectableChanges interface that represents the connection. It exposes the following properties, methods and events.
Properties and methods
Indicates whether it's connected or not
Adds a listener for 'connectionStatus' event
Adds a listener for 'error' event
Returns a Promise resolved once connection to the server is established.
In order to retrieve notifications you have to subscribe to server-side events by using one of the following methods: