self = {
add: function(fn) {
var start = list.length;
list.push(fn)
if (memory) {
firingStart = start; //获取最后一值
_fire();
}
},
fire: function(args) {
if (list) {
memory=[this,arguments];
_fire(args)
}
}
}
add: function(fn) {
var start = list.length;
list.push(fn)
if (memory) {
firingStart = start; //获取最后一值
_fire();
}
},
fire: function(args) {
if (list) {
memory=[this,arguments];
_fire(args)
}
}
}
2016-10-14
新版设计改了 function _fire() {
memory = options === 'memory' && memory;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
for (; list && firingIndex < firingLength; firingIndex++) {
list[firingIndex].apply(memory[0],memory[1]);
}
}
memory = options === 'memory' && memory;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
for (; list && firingIndex < firingLength; firingIndex++) {
list[firingIndex].apply(memory[0],memory[1]);
}
}
2016-10-14
@阿辉2 老师就想让你痛苦痛苦,就是想先把你搞的死死的,然后让你变一个“带把”(吊)的人,兄弟好好享受吧,你要知足啊 /哈哈大笑
2016-10-13