<script>
import InfiniteScroll from "svelte-scroll-infinite";
const promise = fetch(`https://dog.ceo/api/breed/hound/images`)
.then(r => r.json())
.then(r => r.message);
let count = 2;
const loadMore = () => count += 2;
</script>
{#await promise then dogs}
{#each dogs.slice(0, count) as src}
<div><img alt {src}/></div>
{/each}
<InfiniteScroll
hasMore="{count < dogs.length}"
threshold={200}
on:loadMore={loadMore} />
{/await}