Simplify live editor execution logic
Ben Alpert committed
Jan 17, 2014 at 17:42 UTC
ea711f1d6253468dcb01d6f6a35f85d9be0d1541
1 file changed
+2
-2
docs/_js/live_editor.js
+2
-2
@@ -168,9 +168,9 @@ var ReactPlayground = React.createClass({
168
componentWillUpdate: function(nextProps, nextState) {
169
// execute code only when the state's not being updated by switching tab
170
// this avoids re-displaying the error, which comes after a certain delay
171
- if (this.state.mode === nextState.mode) {
171
+ if (this.state.code !== nextState.code) {
172
this.executeCode();
173
- };
173
+ }
174
},
175
176
executeCode: function() {