Support for Symbol.iterator using x-for? #2005
Unanswered
brycekbargar
asked this question in
1. Help
Replies: 1 comment
-
Figured it out! Spreading the object that implements Symbol.iterator into a "real" array works as expected. Curious if there are any footguns with this approach? <template x-for="thing in [...list]">
<li x-text="thing.name"></li>
</template> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How hard would it be to support Symbol.iterator using the x-for directive? I tried digging around in the source but got kind of lost in the
evaluateItems
method.Is there another way I can use Symbol.iterator with Alpine or should I be sticking to plain arrays?
Here's a minimal reproduction of what I'm trying to do.
Beta Was this translation helpful? Give feedback.
All reactions