Check out example codes for "object.assign() in NgRx". It will help you in understanding the concepts better.

Code Example 1

function todoApp(state = initialState, action) {
  switch (action.type) {
    case SET_VISIBILITY_FILTER:
      return Object.assign({}, state, {
        visibilityFilter: action.filter
      })
    default:
      return state
  }
}

Learn ReactJs, React Native from akashmittal.com