samples/remote-sync/websocket/WebSocketSyncServer.js
function (table, key, obj, clientIdentity) {
            // Create table if it doesnt exist:
            db.tables[table] = db.tables[table] || {};
            // Put the obj into to table
            db.tables[table][key] = obj;
            // Register the change:
            db.changes.push({
                rev: ++db.revision,
                source: clientIdentity,
                type: CREATE,
                table: table,
                key: key,
                obj: obj
            });
            db.trigger();
        }
function (table, key, obj, clientIdentity) {
            // Create table if it doesnt exist:
            db.tables[table] = db.tables[table] || {};
            // Put the obj into to table
            db.tables[table][key] = obj;
            // Register the change:
            db.changes.push({
                rev: ++db.revision,
                source: clientIdentity,
                type: CREATE,
                table: table,
                key: key,
                obj: obj
            });
            db.trigger();
        }
function ( table , key , obj , clientIdentity ) { // Create table if it doesnt exist: db . tables [ table ] = db . tables [ table ] || { } ; // Put the obj into to table db . tables [ table ] [ key ] = obj ; // Register the change: db . changes . push ( { rev : ++ db . revision , source : clientIdentity , type : CREATE , table : table , key : key , obj : obj } ) ; db . trigger ( ) ; }
Subscribers to when database got changes. Used by server connections to be able to push out changes to their clients as they occur.
Subscribers to when database got changes . Used by server connections to be able to push out changes to their clients as they occur .