From ea711f1d6253468dcb01d6f6a35f85d9be0d1541 Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Fri, 17 Jan 2014 17:42:53 -0800 Subject: [PATCH] Simplify live editor execution logic --- docs/_js/live_editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_js/live_editor.js b/docs/_js/live_editor.js index e6095cbd6d9ca..af4bc392a5381 100644 --- a/docs/_js/live_editor.js +++ b/docs/_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() {