-
Notifications
You must be signed in to change notification settings - Fork 0
/
a.js
45 lines (39 loc) · 895 Bytes
/
a.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
let ary={};
let addEveventLiKs=function (type,cb) {
if(!ary[type]){
ary[type]=[];
ary[type].push(cb)
}else{
ary[type].push(cb)
}
};
let dispatch=function (data) {
if(ary[data.type]){
ary[data.type].forEach(function (i) {
i(data)
})
}
};
let dispathRemove = function (name) {
if(ary[name]){
ary[name]=[]
}
};
function f1(Event) {
console.log(1,Event);
}
function f2(Event) {
console.log(6,Event);
}
addEveventLiKs('a',f1);
addEveventLiKs('a',f2);
dispatch({type:'a',message:{data:'我不知道对不对,我只知道我特别的'}});
dispathRemove('a');
dispatch({type:'a',message:{data:'LIke'}});
/*---------------------------------------------------*/
emerge 浮现 暴露
status 地位
intermediate 中间的
presence 存在
appliance 用具,器具
emergency 突发情况,紧急情况