我正在阅读ScrollListView的源代码,并在几个地方看到了() => {}.
比如第 25 行,
this.cellReorderThreshold = () => {
var ratio = (this.CELLHEIGHT*this.cellsWithinViewportCount)/4;
return ratio < this.CELLHEIGHT ? 0 : ratio;
};
第 31 行,
this.container.addEventListener('scroll', () => this.onScroll(), false);
第 88 行。
resizeTimer = setTimeout(() => {
this.containerHeight = this.container.offsetHeight;
}, 250);
这是一个简写function,如果它有任何不同,怎么会这样?