会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Code change my mind
You have to believe in yourself. That's the secret of success.
博客园
首页
新随笔
联系
管理
订阅
2018年12月8日
用es6方式的写的订阅发布的模式
摘要: //发布订阅模式 class EventEmiter { constructor() { //维护一个对象 this._events = { } } on(eventName, callback) { if (this._events[eventName]) { //如果有就放一个新的 this._
阅读全文
posted @ 2018-12-08 18:31 focus_yaya
阅读(1651)
评论(0)
推荐(0)
编辑
公告