You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤣 I know, it looks awful, and the connection with the actual controller actions is so tenuous.
I was thinking of writing a helper module for stuff like this to make it more readable. It would be really cool if we could make something like Phoenix's verified_routes. That way we wouldn't need to have magic strings. We could round up all the controller actions in the JS at compile time and set a global verified_stimulus_actions map. The tough part would be somehow generating all the valid event triggers to go with them... maybe we wouldn't have to though. Ending up with something like this:
I was thinking of writing a helper module for stuff like this to make it more readable. It would be really cool if we could make something like Phoenix's verified_routes. That way we wouldn't need to have magic strings. We could round up all the controller actions in the JS at compile time and set a global verified_stimulus_actions map. The tough part would be somehow generating all the valid event triggers to go with them... maybe we wouldn't have to though. Ending up with something like this:
... then have a macro/resolver of some kind check if the action exists and fail more visibly if it does not:
...Something like that anyway.
In the meantime, I was thinking something like this just for readability:
Originally posted by @Shaka-n in #44 (comment)
The text was updated successfully, but these errors were encountered: