Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

Set up a let command for using local vars inside a single event flow #211

Closed bob2517-whiteline closed 9 months ago

bob2517-whiteline commented 2 years ago

Finding myself needing this when not using components, as I just need a temporary variable for counting something and I don't want to populate the document scope.

Do this for 2.10.0.

Note to self for implementation: It should just be a case of calling the var command and populating a different var. Then mapping that into a let reference. Then when getting, check the let reference first, and if it isn't found, use the component/document scope. It won't be reactiveable as a variable and should disappear once the event flow is finished. Each event flow has a unique code, so map the let reference with that and clean up at the end.

bob2517-whiteline commented 2 years ago

The only other issue is usage without declaration, and IIRC there used to something about a scenario for the var command which should be checked out so that we don't unnecessary create a variable in the higher scope. I can't remember if it does that or not, so check that out before doing anything on this.

bob2517 commented 1 year ago

This should get a revised syntax to fit with the new dollar syntax when it is gotten onto. Maybe double-dollar, something like that.

bob2517 commented 11 months ago

Tag for 2.15.0 - spec would be a local variable isolated to a single event. Go with "$$n" to specify an event-local variable unless a better option comes up in the meantime.

bob2517 commented 9 months ago

Closing for now. There's already scoped variables for components for localisation.