Any way to know when a downloaded image of a plot is ready?

I’m specifically using plotly in R, and I’m using the functionality to download a plot as an image. It seems to take several seconds, so I was wondering if there’s any way get a callback when the plot is ready. A javascript event or anything else that I could somehow listen to that will tell me when it is ready

Plotly.downloadImage returns a promise but does not emit an event at the moment unfortunately.