dist/tests.js
/**
     * Append yourself to the list of known Y instances in testconnector.
     * Also initiate sync with all clients.
     */
Append yourself to the list of known Y instances in testconnector.
Also initiate sync with all clients.
Append yourself to the list of known Y instances in testconnector . Also initiate sync with all clients .
connect () {
      if (!this.tc.onlineConns.has(this)) {
        this.tc.onlineConns.add(this);
        const encoder = createEncoder();
        writeSyncStep1(encoder, this);
        broadcastMessage(this, toUint8Array(encoder));
        this.tc.onlineConns.forEach(remoteYInstance => {
          if (remoteYInstance !== this) {
            const encoder = createEncoder();
            writeSyncStep1(encoder, remoteYInstance);
            this._receive(toUint8Array(encoder), remoteYInstance);
          }
        });
      }
    }
connect ( ) { if ( ! this . tc . onlineConns . has ( this ) ) { this . tc . onlineConns . add ( this ) ; const encoder = createEncoder ( ) ; writeSyncStep1 ( encoder , this ) ; broadcastMessage ( this , toUint8Array ( encoder ) ) ; this . tc . onlineConns . forEach ( remoteYInstance => { if ( remoteYInstance !== this ) { const encoder = createEncoder ( ) ; writeSyncStep1 ( encoder , remoteYInstance ) ; this . _receive ( toUint8Array ( encoder ) , remoteYInstance ) ; } } ) ; } }
Append yourself to the list of known Y instances in testconnector.
Append yourself to the list of known Y instances in testconnector .
// publish SyncStep1 // remote instance sends instance to this instance