Skip to content

Commit

Permalink
fix: call debounce statements as they are functions (graphql#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithpabbati authored Jun 5, 2020
1 parent afd9b25 commit 8541250
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/graphiql/src/components/GraphiQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {

handleEditVariables = (value: string) => {
this.setState({ variables: value });
debounce(500, () => this._storage.set('variables', value));
debounce(500, () => this._storage.set('variables', value))();
if (this.props.onEditVariables) {
this.props.onEditVariables(value);
}
Expand Down Expand Up @@ -1217,7 +1217,7 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {
'docExplorerOpen',
JSON.stringify(this.state.docExplorerOpen),
),
);
)();
}
}
}
Expand Down Expand Up @@ -1285,7 +1285,7 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {
this.setState({ editorFlex: leftSize / rightSize });
debounce(500, () =>
this._storage.set('editorFlex', JSON.stringify(this.state.editorFlex)),
);
)();
};

let onMouseUp: OnMouseUpFn = () => {
Expand Down Expand Up @@ -1354,7 +1354,7 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {
'docExplorerWidth',
JSON.stringify(this.state.docExplorerWidth),
),
);
)();
}
this._storage.set(
'docExplorerOpen',
Expand All @@ -1370,7 +1370,7 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {
'docExplorerWidth',
JSON.stringify(this.state.docExplorerWidth),
),
);
)();
}

document.removeEventListener('mousemove', onMouseMove!);
Expand All @@ -1392,7 +1392,7 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {
'docExplorerWidth',
JSON.stringify(this.state.docExplorerWidth),
),
);
)();
};

// Prevent clicking on the tab button from propagating to the resizer.
Expand Down Expand Up @@ -1459,7 +1459,7 @@ export class GraphiQL extends React.Component<GraphiQLProps, GraphiQLState> {
'secondaryEditorHeight',
JSON.stringify(this.state.secondaryEditorHeight),
),
);
)();
};

let onMouseUp: OnMouseUpFn = () => {
Expand Down

0 comments on commit 8541250

Please sign in to comment.