eschutho commented on a change in pull request #12368:
URL: https://github.com/apache/superset/pull/12368#discussion_r554261322



##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -42,6 +43,28 @@ import { Query } from '../types';
 
 const SEARCH_HEIGHT = 46;
 
+const debounce = (
+  func: { apply: (arg0: any, arg1: IArguments) => void },
+  wait: number,
+  immediate: number,
+) => {
+  let timeout: NodeJS.Timeout | null;
+  return function () {
+    // eslint-disable-next-line @typescript-eslint/no-this-alias
+    const context = this;
+    // eslint-disable-next-line prefer-rest-params
+    const args = arguments;
+    const later = function () {

Review comment:
       have you tried an arrow function here so that you don't need to assign 
`this` to context?

##########
File path: superset-frontend/src/SqlLab/components/ResultSet.tsx
##########
@@ -42,6 +43,28 @@ import { Query } from '../types';
 
 const SEARCH_HEIGHT = 46;
 
+const debounce = (
+  func: { apply: (arg0: any, arg1: IArguments) => void },
+  wait: number,
+  immediate: number,
+) => {
+  let timeout: NodeJS.Timeout | null;
+  return function () {
+    // eslint-disable-next-line @typescript-eslint/no-this-alias
+    const context = this;
+    // eslint-disable-next-line prefer-rest-params
+    const args = arguments;
+    const later = function () {

Review comment:
       actually, nm, if you use lodash, you won't need this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to