Skip to content

Idea: component wrapper #49

@knownasilya

Description

@knownasilya

Just thought I'd throw this out there (was think of making an addon) and see if this belongs here:

A component, something like:

{{#state-group 'stateName' identifier=model as |state|}}
  <!-- use state here  -->
{{/state-group}}

<!-- or buffered -->

{{#state-group 'stateName' identifier=model buffered=true
    onapply=(route-action 'saved')
    as |state actions|}}
  <!-- use state here  -->
  <button onclick={{action actions.apply}}>Save</button>
  <button onclick={{action actions.reset}}>Reset</button>
{{/state-group}}

Basically every time this renders you would have like a persistent state object that can be modified without having to inject or make a CP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions