File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 214214
215215- [ V8 源码分析 新生代 Minor GC 的处理细节 新生代的复制 GC 是以空间换时间,且时间代价与存活量成正比。老生代存活量大、体积大,两个维度都不划算] ( https://github.com/ceilf6/Lab/commit/1b07f1c0e29ce967585c35ddfa143fcc55efd9a3 )
216216- [ useFetch useRef 创建在渲染期间持久存在、修改不触发重渲染的容器 AbortController 浏览器原生API用于取消异步操作 useEffect副作用清理函数会 在组件卸载时 以及 依赖项更新副作用下次执行之前 两种情况执行,常用于 AJAX请求、定时器、事件监听、WebSocket 的清理 不用 useCallback 的话,reFetch 每次渲染都会创建一个新的函数引用] ( https://github.com/ceilf6/Lab/commit/6d3dbcefa6db709010caa1fd82e0174877725111 )
217+
218+ - [ Ahooks 源码分析 useRequest 通过 计数器取消异步,没有用 AbortController ,因为 service 可以是任意的异步函数] ( https://github.com/ceilf6/hooks/commit/dc7ade661005f2a7353f21e72a79f095774206f1 )
219+
220+ - [ Ahooks 源码分析 useMemoizedFn: useCallback 依赖变化时引用会变,使用时需要注意依赖; 而 useMemoizedFn 引用永远稳定、无需设置依赖,且始终调用最新函数] ( https://github.com/ceilf6/hooks/commit/f077ec8b9ff57cf0e5466875536116c4d75d747a )
You can’t perform that action at this time.
0 commit comments