···
service
{
content = {
key:[]
}
list = {
}
register = (key, func) => {
list[key] = func
}
unregister = (key) => {
del list[key]
}
update_list = (aaa) =>{
list.map(func=>{
if func
func(aaaa)
})
}
update_chat = () =>{
}
}
mqtt
service.update_list(aaaa)
service.update_chat
page
service.register(key, ()=>{reload})
service.unregister(key);
number_count
service.register(key, ()=>{count++})
service.unregister(key);
···
网友评论