Skip to content
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

Merged
merged 1 commit into from
Aug 19, 2015
Merged

update i13n model when props changes #39

merged 1 commit into from
Aug 19, 2015

Conversation

kaesonho
Copy link
Contributor

@redonkulus @kfay

Previously, to prevent modifying props, we use object-assign for model when we create an i13nNode 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 model

thanks @kfay for addressing this issue

@kaesonho kaesonho force-pushed the updatemodel branch 2 times, most recently from 4d58a4c to 9d78cd9 Compare August 15, 2015 04:13
* @method updateModel
* @param {Object} newModel the new i13n model
*/
I13nNode.prototype.updateModel = function setParentNode (newModel) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function name is incorrect

@kaesonho
Copy link
Contributor Author

I didn't see you guys are reviewing so I squashed.

@yahoocla
Copy link

CLA is valid!

@kaesonho
Copy link
Contributor Author

updated, remove set-immediate, keep the original flow

@kfay
Copy link
Contributor

kfay commented Aug 15, 2015

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
Copy link
Contributor

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

@redonkulus
Copy link
Contributor

one minor, 👍

kaesonho added a commit that referenced this pull request Aug 19, 2015
update i13n model when props changes
@kaesonho kaesonho merged commit 2a6f412 into master Aug 19, 2015
@kaesonho kaesonho deleted the updatemodel branch August 19, 2015 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants