-
Notifications
You must be signed in to change notification settings - Fork 59
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
Metal Lifecycle Method equivalent of componentWillReceiveProps() #106
Comments
I'm not the best to answer this but as that's my 2 cents, @mairatma can certainly provide you a better answer 🙈 |
The main difference is between listening to the change of a key to a lifecycle phase between injection of new values and application of those. |
The nearer you can get is by using |
Oh yeah, I had forgotten about this event, thanks for mentioning it @yuchhi. Maybe the name is not very intuitive, but it will also be called on the first time that |
Oh thanks for that, I think that will suite my purpose fine. Thank you! |
@AngeloYoun since AFAIK Metal doesn’t differentiate between state (internal attributes) and props (public attributes) you can potentially create an infinite loop by updating the configuration during a |
I'll close this since the event is covering the desired use case :) |
@yuchi I just wanted to comment that the way you described the state/props in React is probably the most coherent and concise way of describing them that I've read online :) |
Ahahah thank you @natecavanaugh! |
We have a case where we want to be listening for a change when a config has been updated to a new value.
In React, the way this was done was through listening for any changes to props and then identifying if the prop being changed is different to the old.
I am not convinced that this is the best way of doing this so any alternatives to including a lifecycle method would also be fine.
Thank you!
Angelo Youn
The text was updated successfully, but these errors were encountered: