remove unnecessary item wrapping (#254)

* remove unnecessary item wrapping

* fix lint
This commit is contained in:
Nolan Lawson 2018-05-01 21:05:15 -07:00 committed by GitHub
parent 82a4309454
commit ffa5dcb3ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -1,15 +1,15 @@
<div class="pseudo-virtual-list" on:initialized ref:node> <div class="pseudo-virtual-list" on:initialized ref:node>
{#each wrappedItems as wrappedItem, i (wrappedItem.item)} {#each safeItems as item, i (item)}
<PseudoVirtualListLazyItem <PseudoVirtualListLazyItem
{component} {component}
index={i} index={i}
length={wrappedItems.length} length={safeItems.length}
{makeProps} {makeProps}
key={wrappedItem.item} key={item}
{intersectionObserver} {intersectionObserver}
isIntersecting={isIntersecting(wrappedItem.item, $intersectionStates)} isIntersecting={isIntersecting(item, $intersectionStates)}
isCached={isCached(wrappedItem.item, $intersectionStates)} isCached={isCached(item, $intersectionStates)}
height={getHeight(wrappedItem.item, $intersectionStates)} height={getHeight(item, $intersectionStates)}
/> />
{/each} {/each}
</div> </div>
@ -110,7 +110,7 @@
} }
}, },
computed: { computed: {
wrappedItems: ({ items }) => items ? items.map(item => ({item})) : [], safeItems: ({ items }) => items || [],
allItemsHaveHeight: ({ items, $intersectionStates }) => { allItemsHaveHeight: ({ items, $intersectionStates }) => {
if (!items) { if (!items) {
return false return false