Mainly inspired by PaginateItems and ListingsElements
An inconvenient with this implementation: if a new listing is created (by someone of your group) while you are scrolling, Svelte will throw a no duplicate key error (since the offset will be wrong and fetchMore with return an already fetched listing), which could be handled by turning listings into an object and Object.assign(newListings) to it. I dont think its worth the effort, but that's a notable advantage of using objects over arrays. Note that this would not happen with a cursor based pagination.
Mainly inspired by PaginateItems and ListingsElements An inconvenient with this implementation: if a new listing is created (by someone of your group) while you are scrolling, Svelte will throw a
no duplicate key
error (since the offset will be wrong and fetchMore with return an already fetched listing), which could be handled by turninglistings
into an object andObject.assign(newListings)
to it. I dont think its worth the effort, but that's a notable advantage of using objects over arrays. Note that this would not happen with a cursor based pagination.