function spawnInMemory() {
  var _this5 = this;

  if (!INIT_DONE) {
    INIT_DONE = true; // ensure memory-adapter is added

    if (!_pouchDb.PouchDB.adapters || !_pouchDb.PouchDB.adapters.memory) throw (0, _rxError.newRxError)('IM1');
  }

  if (collectionCacheMap.has(this)) {
    // already exists for this collection -> wait until synced
    return collectionPromiseCacheMap.get(this).then(function () {
      return collectionCacheMap.get(_this5);
    });
  }

  var col = new InMemoryRxCollection(this);
  var preparePromise = col.prepareChild();
  collectionCacheMap.set(this, col);
  collectionPromiseCacheMap.set(this, preparePromise);
  return preparePromise.then(function () {
    return col;
  });
}
/**
 * called in the proto of RxCollection
 */
called in the proto of RxCollection
called in the proto of RxCollection
function spawnInMemory() {
  var _this5 = this;
  if (!INIT_DONE) {
    INIT_DONE = true; 
    if (!_pouchDb.PouchDB.adapters || !_pouchDb.PouchDB.adapters.memory) throw (0, _rxError.newRxError)('IM1');
  }
  if (collectionCacheMap.has(this)) {
    return collectionPromiseCacheMap.get(this).then(function () {
      return collectionCacheMap.get(_this5);
    });
  }
  var col = new InMemoryRxCollection(this);
  var preparePromise = col.prepareChild();
  collectionCacheMap.set(this, col);
  collectionPromiseCacheMap.set(this, preparePromise);
  return preparePromise.then(function () {
    return col;
  });
}
function spawnInMemory ( ) { var _this5 = this ; if ( ! INIT_DONE ) { INIT_DONE = true ; if ( ! _pouchDb . PouchDB . adapters || ! _pouchDb . PouchDB . adapters . memory ) throw ( 0 , _rxError . newRxError ) ( 'IM1' ) ; } if ( collectionCacheMap . has ( this ) ) { return collectionPromiseCacheMap . get ( this ) . then ( function ( ) { return collectionCacheMap . get ( _this5 ) ; } ) ; } var col = new InMemoryRxCollection ( this ) ; var preparePromise = col . prepareChild ( ) ; collectionCacheMap . set ( this , col ) ; collectionPromiseCacheMap . set ( this , preparePromise ) ; return preparePromise . then ( function ( ) { return col ; } ) ; }
called in the proto of RxCollection
called in the proto of RxCollection
// ensure memory-adapter is added // already exists for this collection -> wait until synced