Skip to content

Commit

Permalink
fix(convert-svg-core): fixed error being thrown caused by lost contex…
Browse files Browse the repository at this point in the history
…t for API methods when using destructuring imports #22
  • Loading branch information
neocotic committed Nov 3, 2017
1 parent 9341be4 commit 9248fca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/convert-svg-core/src/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class API {
*/
constructor(provider) {
this[_provider] = provider;

// Workaround for #22 by ensuring all public methods are bound to this instance
this.convert = this.convert.bind(this);
this.convertFile = this.convertFile.bind(this);
this.createConverter = this.createConverter.bind(this);
}

/**
Expand Down

0 comments on commit 9248fca

Please # to comment.