Skip to content

Commit

Permalink
Merge branch 'gldnspud-apiclient-reference-error'
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Rasmussen committed Jul 25, 2015
2 parents ab3e16a + 9452e39 commit 667004a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ApiClient.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import superagent from 'superagent';
import config from 'config';

class ApiClient {
/*
* This silly underscore is here to avoid a mysterious "ReferenceError: ApiClient is not defined" error.
* See Issue #14. https://github.com/erikras/react-redux-universal-hot-example/issues/14
*
* Remove it at your own risk.
*/
class ApiClient_ {
constructor(req) {
['get', 'post', 'put', 'patch', 'del'].
forEach((method) => {
Expand Down Expand Up @@ -42,5 +48,6 @@ class ApiClient {
return '/api' + adjustedPath;
}
}
const ApiClient = ApiClient_;

export default ApiClient;

0 comments on commit 667004a

Please sign in to comment.