ailon / markerjs2

Add image annotation to your web apps.
https://markerjs.com
Other
142 stars 39 forks source link

Request: allow 'render' event listener to be awaited inside `startRenderAndClose` #112

Closed tarngerine closed 2 years ago

tarngerine commented 2 years ago

Repro: https://codesandbox.io/s/blue-http-q6oouz?file=/src/App.tsx

If I provide addEventListener or addRenderEventListener an async handler I would want to be able to await it via startRenderAndClose, but currently it does not await the handler I provide

image
ailon commented 2 years ago

Could you please elaborate on why you need this? Also, is this something any of the standard HTML elements do?

tarngerine commented 2 years ago

The reason I wanted this is because the library provides a startRenderAndClose which is awaitable, so I would expect that to include whatever code is being run within the render event listeners.

But to be fair this is not a pattern that standard HTML elements do. Not a big deal, I can find a workaround.