tim chen

Results 18 comments of tim chen

```js WARNING in ./node_modules/@antv/layout/es/index.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/tim/xxx/node_modules/@antv/layout/src/index.ts' file: Error: ENOENT: no such file or directory, open '/Users/tim/xxx/node_modules/@antv/layout/src/index.ts' ``` solved by: ```js ignoreWarnings:...

> Are you sure this is an issue with craco 7 alpha and not other packages as a result of upgrading to CRA 5? You shouldn't need to update craco...

> @TimRChen I'm not able to install those packages together due to some dependency conflicts. What version of node are you using, by the way? node version is v14.17.2. How...

作者你好,我把你的debounce实现做了下修改,修改如下: ```js function debounce(func, delay) { // 保存函数调用时的上下文和参数,传递给 func const context = this const args = arguments // 返回一个函数,这个函数会在一个时间区间结束后的 delay 毫秒时执行 func 函数 return () => { // 每次这个返回的函数被调用,就清除定时器,以保证不执行 func...

问题在于debounce函数中clearTimeout(timer)语句,其实并没有实质作用。 因为timer变量被保存在debounce方法执行后返回的防抖函数的作用域中,清除的只是当前作用域内的timer变量,重复执行debounce函数,会产生多个防抖函数及其作用域,每个作用域中的timer变量都是不相干的,所以会导致防抖失效。 我稍作修改,这样就正常的实现了防抖功能,以上只是我的个人见解,还请您指教哈哈。

@WanderHuang 是的,您没指出来我都没注意这个问题,感谢指正!

It's great. If this practice show on the official document that will be very awesome!