detach(entity) {
    if (!(entity instanceof AbstractEntity)) {
      throw new TypeError("The entity must be an AbstractEntity instance, " +
          `${entity} provided`)
    }
    let entityClass = entity.constructor
    validateEntityClass(entityClass)

    if (!this[PRIVATE.entities].has(entityClass)) {
      return // the entity is not managed by this entity manager, so we're done
    }

    let entities = this[PRIVATE.entities].get(entityClass)
    let keyPath = this[PRIVATE.entityKeyPaths].get(entityClass.objectStore)

    let primaryKey = getPrimaryKey(entity, keyPath)
    let serializedKey = serializeKey(primaryKey)
    entities.delete(serializedKey)
  }
/**
   * Detaches the provided entity from this entity manager. This entity manager
   * will no longer watch changes in the provided entity during transactions.
   *
   * @param {AbstractEntity} entity The entity to detach from this entity
   *        manager.
   */
Detaches the provided entity from this entity manager. This entity manager
will no longer watch changes in the provided entity during transactions.

@param {AbstractEntity} entity The entity to detach from this entity
manager.
Detaches the provided entity from this entity manager . This entity manager will no longer watch changes in the provided entity during transactions . @param { AbstractEntity } entity The entity to detach from this entity manager .
detach(entity) {
    if (!(entity instanceof AbstractEntity)) {
      throw new TypeError("The entity must be an AbstractEntity instance, " +
          `${entity} provided`)
    }
    let entityClass = entity.constructor
    validateEntityClass(entityClass)
    if (!this[PRIVATE.entities].has(entityClass)) {
      return 
    }
    let entities = this[PRIVATE.entities].get(entityClass)
    let keyPath = this[PRIVATE.entityKeyPaths].get(entityClass.objectStore)
    let primaryKey = getPrimaryKey(entity, keyPath)
    let serializedKey = serializeKey(primaryKey)
    entities.delete(serializedKey)
  }
detach ( entity ) { if ( ! ( entity instanceof AbstractEntity ) ) { throw new TypeError ( "The entity must be an AbstractEntity instance, " + ` ${ entity } ` ) } let entityClass = entity . constructor validateEntityClass ( entityClass ) if ( ! this [ PRIVATE . entities ] . has ( entityClass ) ) { return } let entities = this [ PRIVATE . entities ] . get ( entityClass ) let keyPath = this [ PRIVATE . entityKeyPaths ] . get ( entityClass . objectStore ) let primaryKey = getPrimaryKey ( entity , keyPath ) let serializedKey = serializeKey ( primaryKey ) entities . delete ( serializedKey ) }
Detaches the provided entity from this entity manager.
Detaches the provided entity from this entity manager .
// the entity is not managed by this entity manager, so we're done