Closed lipsumar closed 4 years ago
Hey, @lipsumar! Thank you for this contribution!
The code looks great to me, nice job. I just have one concern - what if someone doesn't want to have events fired by default? Would it make sense to have this turned off by default?
I would add an option inside configuration so folks can enable this, WDYT?
Thanks for the fast review !
To answer your question: events in JavaScript fire all the time, if you don’t listen to them they’re a bit like the tree falling while no one is around :)
If one is interested in getting an event only for one specific render_async, one could use the « event_name » option or filter using event.container
This is released in 2.1.5 version 🎉
Thanks for all the help!
This PR adds 2 generic javascript events:
render_async_load
andrender_async_error
.Use case In a project with a lot of
render_async
, you might want to apply javascript to all content, even content loaded asynchronously. Adding a custom event name for every use ofrender_async
is not practical, so this generic event allows to handle allrender_async
in 1 event handler.