Also DRYs up the init functions so you don't have to maintain the list in multiple places ✨
In this I introduce a new turbo event (turbo:after-stream-render) for parity with the other turbo events, and then use it to register another re-init listener. This may be more invasive that you want (that is, it essentially monkey-patches a new event into Turbo). I can remove the event if you like, it seems harmless and maybe useful for others so figured I'd try this way first.
This has been a long time coming since I figured out how to fix this—please let me know if I'm missing anything, I'm not particularly well-versed in Typescript.
I tested this out locally and it seemed to work fine. Didn't see any tests in the repo 👀
Also DRYs up the init functions so you don't have to maintain the list in multiple places ✨
In this I introduce a new turbo event (
turbo:after-stream-render
) for parity with the other turbo events, and then use it to register another re-init listener. This may be more invasive that you want (that is, it essentially monkey-patches a new event into Turbo). I can remove the event if you like, it seems harmless and maybe useful for others so figured I'd try this way first.This has been a long time coming since I figured out how to fix this—please let me know if I'm missing anything, I'm not particularly well-versed in Typescript.
I tested this out locally and it seemed to work fine. Didn't see any tests in the repo 👀