Skip to content

Commit

Permalink
Simplify live editor execution logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiebits committed Jan 18, 2014
1 parent 4440486 commit ea711f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/_js/live_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit ea711f1

Please sign in to comment.