News for hackers. Stuff that matters.
Re:Ask HN: So, what's up with Phoenix (web framework)? by mstipetic on Saturday August 20, 2022 @07:35AM (#32531219)
Hey Jose, funny to see there answering phoenix questions on a Saturday. Since we're discussing JS, are there any official plans to expose pushing events to the backend directly from JS? What I've been doing (and seen others do) is to assign a hook to a global window variable in the mounted callback, but that seems very hacky.

Is there any reasons why that should be avoided or why you don't want to expose a proper API for that?

Re:Ask HN: So, what's up with Phoenix (web framework)? by josevalim on Saturday August 20, 2022 @07:41AM (#32531246)
You can do it using JS.push from the linked page. You can also use execJS to execute any JS event, including push, from anywhere. I am not sure if this helps though. :)