From 9248fca612a9cbd17b14de66bdb0f3f7511a9dc8 Mon Sep 17 00:00:00 2001 From: Alasdair Mercer Date: Fri, 3 Nov 2017 17:08:58 +0000 Subject: [PATCH] fix(convert-svg-core): fixed error being thrown caused by lost context for API methods when using destructuring imports #22 --- packages/convert-svg-core/src/API.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/convert-svg-core/src/API.js b/packages/convert-svg-core/src/API.js index a570384..d9172ea 100644 --- a/packages/convert-svg-core/src/API.js +++ b/packages/convert-svg-core/src/API.js @@ -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); } /**