docs: function redataComponent(_ref, WrappedComponent) {
      var load = _ref.load,
          shouldReload = _ref.shouldReload,
          mapper = _ref.mapper;
  
      var RedataComponent = function (_PureComponent) {
          _inherits(RedataComponent, _PureComponent);
  
          function RedataComponent(props) {
              _classCallCheck(this, RedataComponent);
  
              var _this = _possibleConstructorReturn(this, (RedataComponent.__proto__ || Object.getPrototypeOf(RedataComponent)).call(this, props));
  
              _this._handleLoadResult = _this._handleLoadResult.bind(_this);
  
              // If it's in the browser, check if there is data coming from server side rendering.
              // If server data not available, or if this is not in browser, do first load.
              typeof window !== 'undefined' && _this._loadFromServerRender() || _this._load();
  
              _this.state = _extends({}, data);
  
              // console.log('data', JSON.parse(JSON.stringify(data)));
              return _this;
          }
  
          _createClass(RedataComponent, [{
              key: 'componentWillUpdate',
              value: function componentWillUpdate(nextProps, nextState) {
                  var props = this.props,
                      state = this.state;
  
                  // If data no longer valid, start loading.
  
                  shouldReload({ props: props, nextProps: nextProps, state: state, nextState: nextState, data: data }) && this._load();
              }
          }, {
              key: 'render',
              value: function render() {
                  // Render wrapped component passing the received props and the spreaded data.
                  return _react2.default.createElement(WrappedComponent, _extends({}, this.props, this.state));
              }
          }, {
              key: '_load',
              value: function _load() {
                  var props = this.props,
                      state = this.state;
  
  
                  load({ props: props, state: state }).then(this._handleLoadResult);
              }
          }, {
              key: '_loadFromServerRender',
              value: function _loadFromServerRender() {
                  var componentUniqueId = this._componentUniqueId();
  
                  // If data was already available from server.
                  if (window.__redata && window.__redata.store && window.__redata.store[componentUniqueId]) {
                      // Store server data in our data.
                      var serverData = window.__redata.store[componentUniqueId];
  
                      data.loading = serverData.loading;
                      data.error = serverData.error;
                      data.result = serverData.result;
  
                      this._handleLoadResult(data);
  
                      return true; // Was able to load from global store.
                  }
  
                  return false; // Was not able to load from global store.
              }
          }, {
              key: '_componentUniqueId',
              value: function _componentUniqueId() {
                  // TODO: investigate how to consistently generate this
                  return 'foo';
              }
          }, {
              key: '_handleLoadResult',
              value: function _handleLoadResult(data) {
                  console.log('new result', data);
                  // Map the load result using the mapper and store it in the state, which will trigger a render.
                  // this.setState({ ...(mapper(data)) });
                  this.setState(_extends({}, data));
              }
          }]);
  
          return RedataComponent;
      }(_react.PureComponent);
  
      RedataComponent.displayName = 'Redata(' + getDisplayName(WrappedComponent) + ')';
  
      return RedataComponent;
  }