// ------------------------------------
// Constants

const COUNTER_INCREMENT = 'COUNTER_INCREMENT';

// ------------------------------------
// Action creators

export function increment(value = 1) {
  return {
    type: COUNTER_INCREMENT,
    payload: value
  };
}

// ------------------------------------
// Selectors

export const getCounter = state => state.mymodule.counter;

// ------------------------------------
// Store & reducer

const initialState = {
  counter: 0
};

export default function reducer(state = initialState, action = {}) {
  switch (action.type) {
  case COUNTER_INCREMENT:
    return Object.assign(
      {},
      state,
      {counter: state.counter + action.payload});
  default:
    return state;
  }
}

// ------------------------------------
// Constants

const COUNTER_INCREMENT = 'COUNTER_INCREMENT';

// ------------------------------------
// Action creators

export function increment(value = 1) {
  return {
    type: COUNTER_INCREMENT,
    payload: value
  };
}

// ------------------------------------
// Selectors

export const getCounter = state => state.mymodule.counter;

// ------------------------------------
// Store & reducer

const initialState = {
  counter: 0
};

export default function reducer(state = initialState, action = {}) {
  switch (action.type) {
  case COUNTER_INCREMENT:
    return {
      ...state,
      counter: state.counter + action.payload
    };
  default:
    return state;
  }
}

Replace Object.assign with the spread object operator (supported by CRA)
Replace Object.assign with the spread object operator (supported by CRA)

Signed-off-by: Gianni Valdambrini <c5d749f9a9fad12805bcb3c96e57c90355771f56@develer.com>
