code: function createAtom(_ref) {
    var type = _ref.type,
        _ref$actionParams = _ref.actionParams,
        actionParams = _ref$actionParams === undefined ? [] : _ref$actionParams,
        _ref$isMutable = _ref.isMutable,
        isMutable = _ref$isMutable === undefined ? actionParams.length > 0 : _ref$isMutable,
        getNewState = _ref.getNewState,
        _ref$react = _ref.react,
        react = _ref$react === undefined ? (0, _utils.handler)(type, getNewState) : _ref$react;
  
    if (!type) {
      throw 'Missing type';
    }
    if (!getNewState) {
      throw 'Missing getNewState';
    }
  
    var atom = function atom() {
      for (var _len = arguments.length, data = Array(_len), _key = 0; _key < _len; _key++) {
        data[_key] = arguments[_key];
      }
  
      _createAtomMiddleware.store.dispatch(createAction(type, actionParams, data));
    };
  
    // must assign one by one because atom is a function, not an object
    atom.type = type;
    atom.actionParams = actionParams;
    atom.getNewState = getNewState;
    atom.isMutable = isMutable;
    atom.react = react;
  
    return atom;
  }
docs: @param: atom: a function that returns an action {type, data...}
  @param: props: an object that contains properties to attach to an atom
  
  @return: a function which can be invoked to create an action,
  this function also has a property 'react', which is a function that can react to an action to return new state