ritz078 / embed-js

🌻 A lightweight plugin to embed emojis, media, maps, tweets, code and more. ✨
https://codesandbox.io/s/Wp5OlNMn
MIT License
1.27k stars 88 forks source link

render() promise #201

Closed vladimir-barsuchenko closed 6 years ago

vladimir-barsuchenko commented 7 years ago

render() promise is fired when html is parsed. But can we get an actual callback when html is fully rendered?

For example, twitter example. Fully rendering appears after 0.5s render() promise is fired.

http://codepen.io/anon/pen/JEGjzj

Thanks!

ritz078 commented 7 years ago

I will look into it.

ritz078 commented 7 years ago

there's a onTweetsLoad() function. It can be passed in options thats fired when the tweets have loaded. You can try that.

MaxLeiter commented 7 years ago

How hard would a onEmbedLoad()? Just for all embeds not just twitter?

ritz078 commented 7 years ago

Eventually I will want to change this library into plugin based and doing that will be tough. Anyways I don't think anything delays except twitter.

ritz078 commented 6 years ago

in v5 twitter plugin is separate and it provides an onLoad() method that gets called when tweets are rendered.