bigskysoftware / bigskysoftware/_hyperscript

unexpected loop behavior when rendering templates.

Open
#590 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.8k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

Hello and thank you so much for this wonderful language!

Hyperscript completely solves all my tasks on the front end, with the exception of a small problem: SET command in the template's loop doesn't work.

The code from the example of using templates does not work:
```


    @repeat in colors
    @set bg to it -- this command return lenght of it, but not it as Object
    @set fg to getContrastingColor(it) -- the same problem
  • ${bg}

  • @end

```

And this code works:
```

@repeat in colors

  • ${it}

  • @end

    ```

    I found a workaround: using loops directly in DOM elements (when more complex logic is required). I'm not very versed in JavaScript (that's why I chose Hyperscript) to send the pull request, but I hope that this bug causes inconvenience to someone else and it can be fixed.

    Contributor guide

    No contributing guide indexed for this repository

    Assessment

    This issue has not been assessed yet.

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.