Fork me on github
上一页 1 2 3 4 5 6 7 ··· 20 下一页
摘要: 阅读全文
posted @ 2023-10-01 17:28 zjy4fun 阅读(25) 评论(0) 推荐(0) 编辑
摘要: https://github.com/zjy4fun/notes/issues/62 React 18 提出的新特性“并发渲染”,为了防止组件重复挂载的问题,React 在开发模式 && 严格模式下,useEffect 会执行两次(模拟组件挂载和组件卸载,让问题提早暴露),但是线上模式不会。 开发模 阅读全文
posted @ 2023-10-01 16:46 zjy4fun 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 参考: https://reactnative.cn/docs/intro-react-native-components 阅读全文
posted @ 2023-09-18 22:25 zjy4fun 阅读(3) 评论(0) 推荐(0) 编辑
摘要: https://github.com/zjy4fun/x-init 安装工具 npm install -g x-init 快速创建一个项目,只需`x projectName`即可快速创建项目,支持国内加速👀 x demo 阅读全文
posted @ 2023-09-11 19:25 zjy4fun 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 递归和非递归版本 const arr = [ 123, 2, [ 2,3,4 ,[ 345, 34, [ 34,34,34 ] ] ] ] const flatten = (arr) => { return arr.reduce((acc, val) => Array.isArray(val) ? 阅读全文
posted @ 2023-09-10 21:53 zjy4fun 阅读(1) 评论(0) 推荐(0) 编辑
摘要: https://github.com/zjy4fun/notes/tree/main/demos/js-promise 三个状态,两个回调队列,then 的时候针对不同状态进行处理 const PENDING = 'PENDING'; const FULFILLED = 'FULFILLED'; c 阅读全文
posted @ 2023-09-10 21:27 zjy4fun 阅读(2) 评论(0) 推荐(0) 编辑
摘要: https://github.com/zjy4fun/notes/tree/main/demos/js-instanceof 原型就是一个对象,instanceof 就是检查构造函数的原型是否在对象的原型链上 function myInstanceOf(obj, constructorFn) { c 阅读全文
posted @ 2023-09-10 20:55 zjy4fun 阅读(16) 评论(0) 推荐(0) 编辑
摘要: https://github.com/zjy4fun/notes/tree/main/demos/js-new const myNew = (constructorFn, ...args) => { const obj = Object.create(constructorFn.prototype) 阅读全文
posted @ 2023-09-10 20:41 zjy4fun 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 控制多个请求的并发度,演示请求的过程和用时结果 demo: https://scheduler-smoky.vercel.app/ github: https://github.com/zjy4fun/scheduler <script setup lang="ts"> import { ref } 阅读全文
posted @ 2023-09-09 20:34 zjy4fun 阅读(68) 评论(0) 推荐(0) 编辑
摘要: class MaxQueue { constructor() { this.queue = [] this.max = [] } enqueue(el) { this.queue.push(el) while(this.max.length && this.max[this.max.length - 阅读全文
posted @ 2023-09-07 22:10 zjy4fun 阅读(5) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 20 下一页