Open NullVoxPopuli opened 1 year ago
I noticed in the README there is:
<h1>Cats of YouTube</h1> <ul> {#each cats as cat} <li><a target="_blank" href={cat.video}>{cat.name}</a></li> {/each} </ul>
and
{#each items as item, i} <p>{i}: {item.name}</p> {/each}
{#each items as item (item.id)} <p>{item.name}</p> {/each}
It would be good to unify the concept of "block params", so that there is only one syntax to mean "these are params passed to the block"
I propose:
{#each items as (item, i, params, here, example)} <p>{item.name}</p> {/each}
and then for specifying the key, since that's a concern of each and not the block params, it should be closer to what each is iterating over.
each
{#each items key='id' as (item, i, params, here, , example)} <p>{item.name}</p> {/each}
(this is in part inspired by the glimmer syntax, where the syntax is immensely narrow, but clear)
I noticed in the README there is:
and
and
It would be good to unify the concept of "block params", so that there is only one syntax to mean "these are params passed to the block"
I propose:
and then for specifying the key, since that's a concern of each and not the block params, it should be closer to what
each
is iterating over.(this is in part inspired by the glimmer syntax, where the syntax is immensely narrow, but clear)