Skip to content

Spread properties and special *state* propertyΒ #195

Closed
@Swatinem

Description

@Swatinem

It would be nice to support spreading into component props and to have a special identifier to access the whole local component state.

Spread could look something like this:

{{#each rects as rect}}
  <Rect {{...rect}} />
  <!-- or -->
  <Rect ...{{rect}} />
  <!-- same as -->
  <Rect x="{{rect.x}}" y="{{rect.y}}" />
{{/each}}

And having a special identifier for the complete state object would make decorator components really awesome, like so:

<!-- RectDecorator.html -->
<Rect {{..._}} foo="bar" />
<!-- same as -->
<Rect x="{{x}}" y="{{y}}" foo="bar" />

<!-- main.html -->
<RectDecorator x="1" y="2" />

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