摘要: 手写一个发布者订阅者模式: // 手写发布订阅模式 EventEmitter class EventEmitter { constructor() { this.events = {}; } // 实现订阅 on(type, callBack) { if (!this.events) this.ev 阅读全文
posted @ 2020-05-29 16:34 仔行天下 阅读(1640) 评论(0) 推荐(0) 编辑