react-i13n
Advanced tools
Comparing version 0.1.22 to 0.1.23
@@ -16,3 +16,3 @@ /** | ||
* @param {Object} parentNode parent node | ||
* @param {Object} model custom model values | ||
* @param {Object|Function} model custom model values | ||
* @param {Boolean} isLeafNode indicate if it's a link node | ||
@@ -286,2 +286,16 @@ * @param {Boolean} isViewportEnabled indicate if viewport check enable | ||
/** | ||
* Update the i13n model | ||
* @method updateModel | ||
* @param {Object|Function} newModel the new i13n model | ||
*/ | ||
I13nNode.prototype.updateModel = function updateModel (newModel) { | ||
// if i13n is a function, just assign it to _model, otherwise use object-assign to merge old and new model data | ||
if ('function' === typeof newModel) { | ||
this._model = newModel; | ||
} else { | ||
this._model = objectAssign({}, this._model, newModel); | ||
} | ||
}; | ||
/** | ||
* Sort children according to the position in the page | ||
@@ -288,0 +302,0 @@ * @method sortChildrenNodes |
@@ -80,2 +80,12 @@ /** | ||
/** | ||
* componentWillUpdate | ||
* @method componentWillUpdate | ||
*/ | ||
componentWillUpdate: function (nextProps, nextState) { | ||
if (nextProps) { | ||
this._i13nNode.updateModel(nextProps.model || nextProps.i13nModel); | ||
} | ||
}, | ||
/** | ||
* componentDidMount | ||
@@ -82,0 +92,0 @@ * @method componentDidMount |
{ | ||
"name": "react-i13n", | ||
"description": "React I13n provides a performant and scalable solution to application instrumentation.", | ||
"version": "0.1.22", | ||
"version": "0.1.23", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76082
25
1860