code: function combine(type) {
    for (var _len = arguments.length, atoms = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      atoms[_key - 1] = arguments[_key];
    }
  
    if (typeof type !== 'string') {
      var firstAtom = type;
      atoms = [firstAtom].concat(_toConsumableArray(atoms));
      type = firstAtom.type;
    }
  
    var actionParams = [];
    atoms.forEach(function (atom) {
      if (atom.isMutable) {
        actionParams.push.apply(actionParams, _toConsumableArray(atom.actionParams));
      }
    });
    if (checkDuplicateParams(actionParams)) {
      throw 'Duplicate parameters when combining atoms';
    }
  
    var getNewState = function getNewState(state, action) {
      var newState = {};
      atoms.forEach(function (atom) {
        if (atom.isMutable) {
          var data = {};
          atom.actionParams.forEach(function (param) {
            data[param] = action[param];
          });
          newState = _extends({}, newState, atom.getNewState(state, data));
        } else {
          newState = _extends({}, newState, atom.getNewState());
        }
      });
      return newState;
    };
  
    return (0, _createAtom2.default)({
      isMutable: atoms.findIndex(function (atom) {
        return atom.isMutable;
      }) >= 0,
      type: type,
      actionParams: actionParams,
      getNewState: getNewState
    });
  }
docs: Author: Quan Vo
  Date: 7/6/18
   
  combine many atoms to a single atom with a new type