/**
 * Keep live updates from service.
 * @constructor
 */
g.live = function() {
    var socket;

    /**
     * Open the websocket connection.
     */
    var open = function() {
        if (g.isEncrypted()) {
            socket = new WebSocket('wss://' + g.getHost() + '/api/live');
        } else {
            socket = new WebSocket('ws://' + g.getHost() + '/api/live');
        }

        socket.onclose = onclose;
        socket.onmessage = onmessage;
    };

    /**
     * onmessage callback.
     * @param {!MessageEvent} event
     */
    var onmessage = function(event) {
        var data = JSON.parse(event.data);

        if (subscriptions.hasOwnProperty(data.type)) {
            subscriptions[data.type].log(data);
        }
    };

    /**
     * Use as onclose callback from websocket, will try to reconnect after
     * two and a half second.
     * @param {!CloseEvent} event
     */
    var onclose = function(event) {
        setTimeout(function() {
            open();
        }, 2500);
    };

    // Open the connection right away.
    open();

    /**
     * @type {Object.<string, g.Collection>}
     */
    var subscriptions = {};

    /**
     * Subscribe a collection.
     * @param {!string} id The type id to subscribe to.
     * @param {!g.Collection} collection The collection to update.
     */
    this.subscribe = function(id, collection) {
        subscriptions[id] = collection;
    };

    return this;
};

@@ -716,16 +716,143 @@
 pe%5D.
-log(data
+forEach(function(collection) %7B%0A                console.log(data, %22to%22, collection);%0A                collection.log(data);%0A            %7D
 );%0A 
@@ -1489,32 +1489,149 @@
 , collection) %7B%0A
+        if (subscriptions.hasOwnProperty(id)) %7B%0A            subscriptions%5Bid%5D.push(collection);%0A        %7D else %7B%0A    
         subscrip
@@ -1642,16 +1642,17 @@
 s%5Bid%5D = 
+%5B
 collecti
@@ -1653,17 +1653,28 @@
 llection
-;
+%5D;%0A        %7D
 %0A    %7D;%0A

Support multiple subscribers in g.Live.