code: function resolveEntityOrId(entityOrId, entities, schema) {
    const key = schema.key;
  
    let entity = entityOrId;
    let id = entityOrId;
  
    if (isObject(entityOrId)) {
      const mutableEntity = isImmutable(entity) ? entity.toJS() : entity;
      id = schema.getId(mutableEntity) || getIn(entity, ['id']);
    } else {
      entity = getIn(entities, [key, id]);
    }
  
    return { entity, id };
  }
docs: Take either an entity or id and derive the other.
  
  @param   {object|Immutable.Map|number|string} entityOrId
  @param   {object|Immutable.Map} entities
  @param   {schema.Entity} schema
  @returns {object}