export default function reduce()

in example/state/reducers/app/metadata.ts [9:30]


export default function reduce(state = DEFAULT_STATE, action) {
  if (action.type === Actions.INCREMENT) {
    return {
      name: 'Increment Value',
      source: 'Incrementer',
      historyIndex: state.historyIndex + 1,
    };
  } else if (action.type === Actions.DECREMENT) {
    return {
      name: 'Decrement Value',
      source: 'Incrementer',
      historyIndex: state.historyIndex + 1,
    };
  } else if (action.type === Actions.PICK_RANDOM_COLOR) {
    return {
      name: 'Pick Random Color',
      source: 'Color Picker',
      historyIndex: state.historyIndex + 1,
    };
  }
  return state;
}