From edf47d3491f478956884d99c26ab10025fe1d889 Mon Sep 17 00:00:00 2001
From: Kevin Jahns <kevin.jahns@rwth-aachen.de>
Date: Fri, 12 May 2017 04:19:14 +0200
Subject: [PATCH] add disconnect / reconnect return values

---
 dist              | 2 +-
 src/Connector.js  | 5 +++--
 src/SpecHelper.js | 4 +---
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/dist b/dist
index 73e53e3d..3eafd787 160000
--- a/dist
+++ b/dist
@@ -1 +1 @@
-Subproject commit 73e53e3dccebe643fecb70e87aa319d6a0bb2f67
+Subproject commit 3eafd78710a30cd01bf4c6b3553c141e7ac604a5
diff --git a/src/Connector.js b/src/Connector.js
index fe2d52be..edf06719 100644
--- a/src/Connector.js
+++ b/src/Connector.js
@@ -79,7 +79,7 @@ module.exports = function (Y/* :any */) {
     }
     reconnect () {
       this.log('reconnecting..')
-      this.y.db.startGarbageCollector()
+      return this.y.db.startGarbageCollector()
     }
     disconnect () {
       this.log('discronnecting..')
@@ -88,7 +88,8 @@ module.exports = function (Y/* :any */) {
       this.currentSyncTarget = null
       this.syncingClients = []
       this.whenSyncedListeners = []
-      return this.y.db.stopGarbageCollector()
+      this.y.db.stopGarbageCollector()
+      return this.y.db.whenTransactionsFinished()
     }
     repair () {
       this.log('Repairing the state of Yjs. This can happen if messages get lost, and Yjs detects that something is wrong. If this happens often, please report an issue here: https://github.com/y-js/yjs/issues')
diff --git a/src/SpecHelper.js b/src/SpecHelper.js
index f6861686..90c81be2 100644
--- a/src/SpecHelper.js
+++ b/src/SpecHelper.js
@@ -11,9 +11,7 @@ require('../../y-memory/src/Memory.js')(Y)
 require('../../y-array/src/Array.js')(Y)
 require('../../y-map/src/Map.js')(Y)
 require('../../y-indexeddb/src/IndexedDB.js')(Y)
-if (typeof window === 'undefined') {
-  require('../../y-leveldb/src/LevelDB.js')(Y)
-}
+
 module.exports = Y
 
 var g