[QUESTION] Is there a way to alter limitToLast value?
See original GitHub issueHello, I try to create a simple pagination based on scrolling. When scroll touches the top, contentCount increases. So, we alter limit actually but it does not effect the result.
const [contentCount, setContentCount] = useState(9)
const firebaseApp = useFirebaseApp();
const ref firebaseApp.database().ref('dialogContents').orderByKey().limitToLast(contentCount);
What is the best way to change this limit?
Best regards
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Change limitToLast dynamically - firebase - Stack Overflow
If you have a query like this: var query = ref.orderByKey().limitToLast(10). And you want to change the number of items shown, you will...
Read more >Collection Queries with Firebase
Review value and child_added events in the docs and answer the following questions. Which event is best for returning a single item? Which...
Read more >Work with Lists of Data on the Web - Firebase - Google
On this page · Get a database reference · Reading and writing lists. Append to a list of data; Listen for child events;...
Read more >firebase get last 10 items | The AI Search Engine You Control
Here we will use the DatabaseReference ;s methods which are limitToFirst(int) OR limitToLast(int) to get the first or last records from FireBase ....
Read more >Best Practices: Arrays in Firebase
If you store an array, it really gets stored as an "object" with integers ... time to remove 'bar'! // this is the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @MuratDoner , this is caused by a bug in ReactFire where it failed to requery if
limitToLast
or other query modifiers were changed. It will be fixed by #167Hey @jhuleatt, It works like a charm now 😃 Sample: https://codesandbox.io/embed/elated-dijkstra-7u6i7?fontsize=14
When limit increases, list size also increases until the maximum data size (25)