'use strict';

var socket;

/**
 * push a document to any clients that need it through a websocket. This allows the browser to receive the documents for offline use
 * as soon as they are saved
 * @param docVersions - list of current document versions to push
 */
exports.pushDocumentVersions = function (docVersions, currentDocument) {
    if (!socket) {
        socket = require('../socket/SocketServer');
    }

    socket.pushDocumentVersions(docVersions, currentDocument);
};