Commit 039d8670 authored by Robert Knight's avatar Robert Knight

Add JSDoc comments to Streamer.{connect, reconnect}

parent d39da102
......@@ -187,21 +187,38 @@ function Streamer($rootScope, annotationMapper, annotationUI, auth,
});
};
var connect = function () {
/**
* Connect to the Hypothesis real time update service.
*
* If the service has already connected this does nothing.
*
* @return {Promise} Promise which resolves once the WebSocket connection
* process has started.
*/
function connect() {
if (socket) {
return Promise.resolve();
}
return _connect();
};
}
var reconnect = function () {
/**
* Connect to the Hypothesis real time update service.
*
* If the service has already connected this closes the existing connection
* and reconnects.
*
* @return {Promise} Promise which resolves once the WebSocket connection
* process has started.
*/
function reconnect() {
if (socket) {
socket.close();
}
return _connect();
};
}
function applyPendingUpdates() {
var updates = Object.values(pendingUpdates);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment