File tree Expand file tree Collapse file tree 5 files changed +190
-171
lines changed
Expand file tree Collapse file tree 5 files changed +190
-171
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ export default class EditorLayout extends React.Component {
1313 layoutActions : PropTypes . object . isRequired
1414 }
1515
16+ onChange = ( newYaml ) => {
17+ this . props . specActions . updateSpec ( newYaml )
18+ }
19+
1620 render ( ) {
1721 let { getComponent } = this . props
1822
@@ -26,7 +30,9 @@ export default class EditorLayout extends React.Component {
2630 < div >
2731 < Container className = 'container' >
2832 < SplitPaneMode >
29- < EditorContainer />
33+ < EditorContainer
34+ onChange = { this . onChange }
35+ />
3036 < UIBaseLayout />
3137 </ SplitPaneMode >
3238 </ Container >
Original file line number Diff line number Diff line change 11import React from "react"
22import PropTypes from "prop-types"
3- import debounce from "lodash/debounce"
4-
5-
6- const DEBOUNCE_TIME = 800 // 0.5 imperial seconds™
73
84export default class EditorContainer extends React . Component {
95
10- constructor ( props , context ) {
11- super ( props , context )
12- this . onChange = debounce ( this . _onChange . bind ( this ) , DEBOUNCE_TIME )
13- }
14-
15- _onChange ( value ) {
16- if ( typeof this . props . onChange === "function" ) {
17- this . props . onChange ( value )
18- }
19- this . props . specActions . updateSpec ( value )
6+ // This is already debounced by editor.jsx
7+ onChange = ( value ) => {
8+ this . props . onChange ( value )
209 }
2110
2211 render ( ) {
You can’t perform that action at this time.
0 commit comments