From dc873f1142024c3b955c6ded1a5c0e5909b2b2b0 Mon Sep 17 00:00:00 2001 From: Matthew Scott Date: Sat, 18 Jul 2015 15:20:25 -0700 Subject: [PATCH] Mask ApiClient into a variable - #14 This, for reasons unknown at the time of this commit, allows us to avoid the mysterious "ReferenceError: ApiClient is not defined" error that appears the first time you run "npm run dev" (or every time when run inside a docker container). --- src/ApiClient.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ApiClient.js b/src/ApiClient.js index 307911da4..01e51abc7 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -2,7 +2,7 @@ import superagent from 'superagent'; import config from 'config'; -class ApiClient { +class ApiClient_ { constructor(req) { ['get', 'post', 'put', 'patch', 'del']. forEach((method) => { @@ -33,6 +33,8 @@ class ApiClient { } } +let ApiClient = ApiClient_; + function formatUrl(path) { let adjustedPath = path[0] !== '/' ? '/' + path : path; if (__SERVER__) {