Browse Source

Simplify live editor execution logic

main
Ben Alpert 11 years ago
parent
commit
dd2dc27184
  1. 4
      _js/live_editor.js

4
_js/live_editor.js

@ -168,9 +168,9 @@ var ReactPlayground = React.createClass({
componentWillUpdate: function(nextProps, nextState) {
// execute code only when the state's not being updated by switching tab
// this avoids re-displaying the error, which comes after a certain delay
if (this.state.mode === nextState.mode) {
if (this.state.code !== nextState.code) {
this.executeCode();
};
}
},
executeCode: function() {

Loading…
Cancel
Save