export default function makeReducer()

in src/state/reducers/dragDrop.ts [17:41]


export default function makeReducer(config: IConfiguration<any>) {
  return function reduce(state = INITIAL_STATE, action) {
    let result = state;
    if (action.type === BOOKMARK_DRAG_START) {
      result = {
        ...state,
        sourceIndex: action.payload.index,
        sourceKey: action.payload.key,
      };
    } else if (action.type === BOOKMARK_DRAG_HOVER) {
      const hoverIndex = action.payload.index;
      result = {
        ...state,
        hoverIndex,
      };
    } else if (action.type === BOOKMARK_DRAG_DROP) {
      result = INITIAL_STATE;
    } else if (action.type === BOOKMARK_DRAG_CANCEL) {
      result = INITIAL_STATE;
    } else if (action.type.indexOf('DAG_HISTORY_') !== 0 && config.actionFilter(action.type)) {
      result = INITIAL_STATE;
    }
    return result;
  };
}