js-image-compressor icon indicating copy to clipboard operation
js-image-compressor copied to clipboard

add typescript definition and fix this is undefined

Open wanglam opened this issue 2 years ago • 0 comments

Thanks for this package. I found issues when I using this package. So I want to fix them. In the first commit, I add a typescript definition for this package, then we don't need to write a extra definition file for this package. In the second commit, I fix a bug in the error callback. When Image onerror method call, "this.options" in error method will be undefined (Because we call it in onerror callback). So I add a .bind(_this) to fix this bug.

wanglam avatar Apr 07 '22 11:04 wanglam