Swarup Karavadi
@swazza85
diff-patch-apply
{0} $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: {1}
var ee = new EventEmitter()
var reactInput = React.createClass({
getInitialState: function () {
return { value: "" };
},
onInputChange: function(e) {
var newValue = e.target.value;
el.setState({value: newValue});
ee.emitEvent('valueChanged', [newValue]);
},
render: function() {
return React.createElement("input", { type: "text", onChange: this.onInputChange, value: this.state.value })
}
});
var reactSpan = React.createClass({
getInitialState: function () {
return { value: "" }
},
componentWillMount: function () {
ee.addListener('valueChanged', function(newValue) {
el2.setState({ value: newValue });
});
},
render: function () {
return React.createElement("span", null, this.state.value)
}
});
var el = React.render(React.createElement(reactInput), document.getElementById("mountNode"))
var el2 = React.render(React.createElement(reactSpan), document.getElementById("mountNode1"))
// Time T0
var tree = render(getData());
var rootNode = createElement(tree);
var vdom = document.getElementById("vdomRoot");
vdom.appendChild(rootNode);
// Time T1
var newTree = render(getData());
var patches = diff(tree, newTree);
rootNode = patch(rootNode, patches);
tree = newTree;
// Time TN
var newTree = render(getData());
var patches = diff(tree, newTree);
rootNode = patch(rootNode, patches);
tree = newTree;
Angular
React