-
-
Notifications
You must be signed in to change notification settings - Fork 113
Component.for(data) makes it hard to use data #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In order to improve the situation described in #216 the `Component.for(item)` now passes the `item` along when the new component is created (only the first time). This makes users able to define their components in ways compatible with both patterns so that `new Component(data)` and `Component.for(data)` would pass data around when/if necessary, leaving to developers the choice on how/if store such data internally or not.
Addressing the TODOs since it was straight forward to improve the pattern:
|
In order to improve the situation described in #216 the `Component.for(item)` now passes the `item` along when the new component is created (only the first time). This makes users able to define their components in ways compatible with both patterns so that `new Component(data)` and `Component.for(data)` would pass data around when/if necessary, leaving to developers the choice on how/if store such data internally or not.
In order to improve the situation described in #216 the `Component.for(item)` now passes the `item` along when the new component is created (only the first time). This makes users able to define their components in ways compatible with both patterns so that `new Component(data)` and `Component.for(data)` would pass data around when/if necessary, leaving to developers the choice on how/if store such data internally or not.
In order to improve the situation described in #216 the `Component.for(item)` now passes the `item` along when the new component is created (only the first time). This makes users able to define their components in ways compatible with both patterns so that `new Component(data)` and `Component.for(data)` would pass data around when/if necessary, leaving to developers the choice on how/if store such data internally or not.
In order to improve the situation described in #216 the `Component.for(item)` now passes the `item` along when the new component is created (only the first time). This makes users able to define their components in ways compatible with both patterns so that `new Component(data)` and `Component.for(data)` would pass data around when/if necessary, leaving to developers the choice on how/if store such data internally or not.
Updated viperHTML too. |
@WebReflection thanks a lot for including this. I was banging my head for hours on how to pass a redux store from one component to another. Than I found this issue. Than I noticed that I was still using You are doing incredible work here. I feel that you anticipated my problem before I even had it 😂 |
While answering this StackOverflow post I've realized that
Component.for(item)
makes the usage ofitem
itself impossible if not through a redundantComponent.for(item).update(item)
as pattern suggested whenComponent.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
Component.for
'cause it's fully missing everywhereThe text was updated successfully, but these errors were encountered: