title: Is it possible to connect non component Class to redux store?
body: <p>So I am using a react-redux boilerplate that has an ApiClient helper. It looks like this:</p>
  
  <pre><code>export default class ApiClient {
    constructor(req) {
      /* eslint-disable no-return-assign */
      methods.forEach((method) =&gt;
        this[method] = (path, withCredentials, { params, data } = {}) =&gt; new Promise((resolve, reject) =&gt; {
  
          const request = superagent[method](formatUrl(path))
  
          if (withCredentials) {
            console.log('first of all, its true')
            console.log(this)
          }
  
          if (params) {
            request.query(params)
          }
  
          if (__SERVER__ &amp;&amp; req.get('cookie')) {
            request.set('cookie', req.get('cookie'))
          }
  
          if (data) {
            request.send(data)
          }
  
          request.end((err, { body } = {}) =&gt; {
  
            return err ? reject(body || err) : resolve(body)
  
          })
        }))
      /* eslint-enable no-return-assign */
    }
    /*
     * There's a V8 bug where, when using Babel, exporting classes with only
     * constructors sometimes fails. Until it's patched, this is a solution to
     * "ApiClient is not defined" from issue #14.
     * https://github.com/erikras/react-redux-universal-hot-example/issues/14
     *
     * Relevant Babel bug (but they claim it's V8): https://phabricator.babeljs.io/T2455
     *
     * Remove it at your own risk.
     */
    empty() {}
  }
  </code></pre>
  
  <p>I want to connect this to my auth so that I can prepend headers to protected endpoints, like so:</p>
  
  <pre><code>@connect(state =&gt; ({ jwt: state.auth.jwt }))
  export default class ApiClient {
    ...
  </code></pre>
  
  <p>However, when I do this, I get the error: <code>Cannot read property 'store' of undefined</code>. What's going on here? Why can't I connect a regular Class to the redux store?</p>
  
  <p><strong>Update:</strong> here's my login function, which uses the ApiClient helper:</p>
  
  <pre><code>export function loginAndGetFullInto(email, password) {
    return dispatch =&gt; {
      return dispatch(login(email, password))
      .then(() =&gt; {
        return dispatch(loadUserWithAuth())
      })
    }
  }
  </code></pre>
  
  <p>I need some way to either pass the store, or the jwt, into the <code>loadUserWithAuth</code> function...</p>