Skip to content

Allow use of for loops with for .. in .. { ... } syntax in html! #1451

@ranile

Description

@ranile

Describe the feature you'd like
Allow using for loops like:

html! {
    for val in range {
      <p> { val } </p>
    }
}

Is your feature request related to a problem? Please describe. (Optional)
Current solutions hurt readability when used inside deeply nested html and imo, aren't that concise.

Describe alternatives you've considered (Optional)
There are two alternatives to this (mentioned here). Both of which require you to wrap them in html! or empty tags which doesn't read well.

Additional context (Optional)
This will also bring loop syntax inside html! in-line with the if statement synatx

Questionnaire

  • I'm interested in implementing this myself but don't know where to start
  • I would like to add this feature
  • I don't have time to add this right now, but maybe later

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions