Automatically wrap JS in self-invoking function #472
JuroOravec
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Seeing the example JS script in README:
I thought it could be a nice quality of life addition to automatically wrap JS in self-invoking functions. So users could write just
and we would wrap it in a function for them to scope the variables:
Considerations
To make it easy to override, it should be it's own method on the Component class, e.g.
render_js
andrender_css
.While it should be easy to do this for JS/CSS defined directly on the Component class (
Component.js
/Component.css
), I'm not sure if this would be possible for JS/CSS referenced by file paths (Component.Media.js
,Component.Media.css
)Beta Was this translation helpful? Give feedback.
All reactions