摘要:
自定义事件总线 自定义事件总线属于一种观察者模式,其中包括三个角色: 口发布者(Publisher):发出事件(Event); 口订阅者(Subscriber):订阅事件(Event),并且会进行响应(Handler); 口事件总线(EventBus):无论是发布者还是订阅者都是通过事件总线作为中台 阅读全文
posted @ 2023-10-14 22:18
KooTeam
阅读(88)
评论(0)
推荐(0)
摘要:
深拷贝基本实现 1 深拷贝基本实现 2 function isObject(value){ 3 const valueType=typeof value 4 return (value!==null)&&(valueType 'object'||valueType 'function') 5 } 6 阅读全文
posted @ 2023-10-14 22:15
KooTeam
阅读(14)
评论(0)
推荐(0)
摘要:
防抖函数基本实现 1 function debounce(fn,delay){ 2 let timer=null 3 return function(...args){ 4 if(timer)clearTimeout(timer) 5 timer=setTimeout(() => { 6 fn.ap 阅读全文
posted @ 2023-10-14 17:52
KooTeam
阅读(28)
评论(0)
推荐(0)

浙公网安备 33010602011771号