Replies: 4 comments
-
Start a new pull request in StackBlitz Codeflow. |
Beta Was this translation helpful? Give feedback.
-
I think putting ...
@for (page of result.data.pages; track $index) {
@for (post of page.data; track $index) {
... The outer for loop carries the pages it has fetched so far and accordingly re-renders them too. The inner one is for rendering their contents, thus why i said that placing an |
Beta Was this translation helpful? Give feedback.
-
but what if i don't have |
Beta Was this translation helpful? Give feedback.
-
then check the length property inside the first for loop |
Beta Was this translation helpful? Give feedback.
-
Which @ngneat/query-* package(s) are the source of the bug?
query
Is this a regression?
No
Description
I've created a code example for infinite scrolling.
However, I'm unsure how to determine when there is no data available, meaning there are no results.
Initially, I updated it to be empty:
observer.next({ data: [], nextId: null, previousId: null });
Now, I want to display "it's empty" in the UI. I tried checking the
pages
property, but even when there's no data, it shows a length of 1.Is there a better way to determine if the data is empty than going to the first index and checking the data?
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-kuxqvm
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
No response
Anything else?
No response
Do you want to create a pull request?
Yes
Beta Was this translation helpful? Give feedback.
All reactions