Skip to content

{{#each things as thing by thing}} #703

@Rich-Harris

Description

@Rich-Harris

As mentioned in #700, it's sometimes useful to be able to use a list item as the basis for keyed updates, rather than a property of each list item.

That could be done a few different ways, e.g.:

{{#each things as thing @}}
{{#each things as thing @this}}
{{#each things as thing by thing}}

One potentially nice feature of the last option, apart from the fact that it doesn't have off-putting special characters, is that it could be more flexible — as well as by thing or by thing.id it could potentially be any expression:

{{#each things as thing by getId(thing)}}

Haven't looked into whether that's feasible. Just wondering about whether it would be desirable if so. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions