tanjinzhou
4 years ago
6 changed files with 9 additions and 56 deletions
@ -1,23 +0,0 @@
|
||||
import { Item } from '../Item'; |
||||
|
||||
export default function useChildren( |
||||
list, |
||||
startIndex, |
||||
endIndex, |
||||
setNodeRef, |
||||
renderFunc, |
||||
{ getKey }, |
||||
) { |
||||
return list.slice(startIndex, endIndex + 1).map((item, index) => { |
||||
const eleIndex = startIndex + index; |
||||
const node = renderFunc(item, eleIndex, { |
||||
// style: status === 'MEASURE_START' ? { visibility: 'hidden' } : {}, |
||||
}); |
||||
const key = getKey(item); |
||||
return ( |
||||
<Item key={key} setRef={ele => setNodeRef(item, ele)}> |
||||
{node} |
||||
</Item> |
||||
); |
||||
}); |
||||
} |
@ -1,19 +0,0 @@
|
||||
// Firefox has low performance of map.
|
||||
class CacheMap { |
||||
maps; |
||||
|
||||
constructor() { |
||||
this.maps = {}; |
||||
this.maps.prototype = null; |
||||
} |
||||
|
||||
set(key, value) { |
||||
this.maps[key] = value; |
||||
} |
||||
|
||||
get(key) { |
||||
return this.maps[key]; |
||||
} |
||||
} |
||||
|
||||
export default CacheMap; |
Loading…
Reference in new issue