diff --git a/src/components/connect-request.js b/src/components/connect-request.js index 1a72ac93..fce45dda 100644 --- a/src/components/connect-request.js +++ b/src/components/connect-request.js @@ -31,6 +31,8 @@ const connectRequest = (mapPropsToConfigs, options = {}) => WrappedComponent => constructor() { super(); + this.forceRequest = this.forceRequest.bind(this); + // A set of URLs that identify all pending requests this._pendingRequests = {}; this._wrappedInstance = null; @@ -115,22 +117,23 @@ const connectRequest = (mapPropsToConfigs, options = {}) => WrappedComponent => } } - render() { - const configs = mapPropsToConfigs(this.props); - const forceRequest = partial(this.requestAsync.bind(this), configs, true, false); + forceRequest() { + this.requestAsync(mapPropsToConfigs(this.props), true, false); + } + render() { if (withRef) { return ( { this._wrappedInstance = ref; }} /> ); } else { - return ; + return ; } } }