-
Notifications
You must be signed in to change notification settings - Fork 42
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
update i13n model when props changes #39
Conversation
4d58a4c
to
9d78cd9
Compare
* @method updateModel | ||
* @param {Object} newModel the new i13n model | ||
*/ | ||
I13nNode.prototype.updateModel = function setParentNode (newModel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function name is incorrect
I didn't see you guys are reviewing so I squashed. |
CLA is valid! |
updated, remove set-immediate, keep the original flow |
LGTM, thanks! (might want to squash again though) :) |
@@ -282,6 +282,20 @@ I13nNode.prototype.setParentNode = function setParentNode (parentNode) { | |||
}; | |||
|
|||
/** | |||
* Update the i13n model | |||
* @method updateModel | |||
* @param {Object} newModel the new i13n model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment to also allow function
one minor, 👍 |
update i13n model when props changes
@redonkulus @kfay
Previously, to prevent modifying props, we use
object-assign
formodel
when we create ani13nNode
https://github.com/yahoo/react-i13n/blob/master/src/libs/I13nNode.js#L31, the problem is it's never updated when we have props change.implement
componentWillUpdate
and update i13n modelthanks @kfay for addressing this issue