设计模式:发布订阅模式

-- KChris 2017.3.15 (=^.^=)this

发布订阅模式,也称为观察者模式。code

1.简单的例子:server

document.body.addEventListener('click', function () {
    console.log('this is the observer.')
    console.log(1)
} )

2.如今来看看,稍微一点点复杂的例子:io

相关文章
相关标签/搜索