Closed ideyuta closed 7 years ago
Generated method does not binding this. So, can't access the simple-api-client methods.
this
simple-api-client
I changed it to bind this, so check it.
Now
export default class APIClient extends SimpleAPIClient { userCreate() { ... this.post(path, opts); // this.post is undefined } }
Fixed
export default class APIClient extends SimpleAPIClient { userCreate = () => { ... this.post(path, opts); // LGTM } }
cc @moqada
@moqada
This problem concerns the design around bind, so we withdraw once. ðŸ˜
Generated method does not binding
this
. So, can't access thesimple-api-client
methods.I changed it to bind
this
, so check it.Now
Fixed
cc @moqada