Skip to content

Component.for(data) makes it hard to use data #216

Closed
@WebReflection

Description

@WebReflection

While answering this StackOverflow post I've realized that Component.for(item) makes the usage of item itself impossible if not through a redundant Component.for(item).update(item) as pattern suggested when Component.for was introduced.

It would be probably very handy/awesome to be able to get back the context/object used to create the component, so that internally one could retrieve data via this.owner.id, as example.

TODO

  • avoid any memory leak through cross referenced components/contexts
  • think about an accessor name that makes sense (i.e. owner is misleading)
  • write documentation about Component.for 'cause it's fully missing everywhere

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions