function updateState(state, update) {
  var ret = Object.create(state);
  Object.keys(update).forEach(function(updatedKey) {
    ret[updatedKey] = update[updatedKey];
  });
  return ret;
}
Updates a copy of a given state with "update" and returns an updated state.

@param  {object} state
@param  {object} update
@return {object}