import { createReducer } from 'redux-act';

import { fetchCollectionStatus, triggerCollectionCancel, ingestDocument } from 'src/actions';
import { objectLoadStart, objectLoadError, objectLoadComplete } from 'src/reducers/util';

const initialState = {};

export default createReducer({
  [fetchCollectionStatus.START]:
    (state, { id }) => objectLoadStart(state, id),

  [fetchCollectionStatus.ERROR]:
    (state, { error, args: { id } }) => objectLoadError(state, id, error),

  [fetchCollectionStatus.COMPLETE]:
    (state, { id, data }) => objectLoadComplete(state, id, data),

  [triggerCollectionCancel.COMPLETE]:
    (state, { id, data }) => objectLoadComplete(state, id, data),

  [ingestDocument.COMPLETE]:
    (state, { id, data }) => {},

}, initialState);

@@ -715,35 +715,16 @@
 %5D:%0A    (
-state, %7B id, data %7D
 ) =%3E %7B%7D,

Remove args