old_contents: import {
    updateManyResourcesMeta, xhrStatuses, initialResourceMetaState,
    upsertManyResources
  } from '../utils';
  
  export function retrieveMany(idAttr, state) {
    return {
      ...state,
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.PENDING
      }
    };
  }
  
  export function retrieveManyFail(idAttr, state) {
    return {
      ...state,
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.FAILED
      }
    };
  }
  
  export function retrieveManySucceed(idAttr, state, action) {
    const resources = action.resources;
    // This needs to use `idAttr`.
    const ids = resources.map(r => r[idAttr]);
  
  
    const replace = typeof action.replace !== 'undefined' ? action.replace : true;
  
    let newResources;
    if (!replace) {
      newResources = upsertManyResources(state.resources, resources, idAttr, false);
    } else {
      newResources = resources;
    }
  
    return {
      ...state,
      resources: newResources,
      // We have new resources, so we need to update their meta state with the
      // initial meta state.
      resourcesMeta: updateManyResourcesMeta(state.resourcesMeta, initialResourceMetaState, ids),
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.SUCCEEDED
      }
    };
  }
  
  export function retrieveManyAbort(idAttr, state) {
    return {
      ...state,
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.ABORTED
      }
    };
  }
  
  export function retrieveManyReset(idAttr, state) {
    return {
      ...state,
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.NULL
      }
    };
  }
  
new_contents: import {
    updateManyResourcesMeta, xhrStatuses, initialResourceMetaState,
    upsertManyResources
  } from '../utils';
  
  export function retrieveMany(idAttr, state) {
    return {
      ...state,
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.PENDING
      }
    };
  }
  
  export function retrieveManyFail(idAttr, state) {
    return {
      ...state,
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.FAILED
      }
    };
  }
  
  export function retrieveManySucceed(idAttr, state, action) {
    const resources = action.resources;
    const ids = resources.map(r => r[idAttr]);
    const replace = typeof action.replace !== 'undefined' ? action.replace : true;
  
    let newResources;
    if (!replace) {
      newResources = upsertManyResources(state.resources, resources, idAttr, false);
    } else {
      newResources = resources;
    }
  
    return {
      ...state,
      resources: newResources,
      // We have new resources, so we need to update their meta state with the
      // initial meta state.
      resourcesMeta: updateManyResourcesMeta(state.resourcesMeta, initialResourceMetaState, ids),
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.SUCCEEDED
      }
    };
  }
  
  export function retrieveManyAbort(idAttr, state) {
    return {
      ...state,
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.ABORTED
      }
    };
  }
  
  export function retrieveManyReset(idAttr, state) {
    return {
      ...state,
      resourcesListMeta: {
        ...state.resourcesListMeta,
        retrievingStatus: xhrStatuses.NULL
      }
    };
  }
  
subject: Remove unnecessary comment