ngxs-labs / firestore-plugin

Firestore plugin for NGXS
https://ngxs-firebase-plugin.netlify.com/
MIT License
20 stars 14 forks source link

How to use page$ #47

Open santekotturi opened 3 years ago

santekotturi commented 3 years ago

Are there docs for how to implement pagination? I looked through the src and am just confused about how to update the pagination cursor.

This post seems to re-implement pagination using this plugin in its own way: https://sanchezcarlosjr.medium.com/paginate-data-with-query-cursors-from-firestore-and-angular-3ba7854afa67

joaqcid commented 3 years ago

hi @skotturi

the library does have a page$method, but its not very clean the way it works, and that's why i havent added to the docs

im working on introducing a cleaner way to use paged queries with the plugin, but still not quite there to release it

for now, you'll need to create some ad-hoc solution such the one you mentioned or perhaps even do it outside the plugin connect method

joaqcid commented 2 years ago

hi @skotturi

i released a first version to use paging in the plugin, its the simplest approach to start with, would love your feedback of it!

https://github.com/ngxs-labs/firestore-plugin#paging

santekotturi commented 2 years ago

Hey @joaqcid looking forward to testing this! I've been building out a ton of new features recently but looking forward to implementing and giving feedback on this

joaqcid commented 1 year ago

@skotturi have you tried the paging functionality? https://github.com/ngxs-labs/firestore-plugin#paging

mihajlosavkic commented 1 year ago

Hi @joaqcid Is there an example on how to use the GetNextPage that is mentioned in the article above, I can't get my head around this, and this is the only bit I am missing now?

joaqcid commented 1 year ago

@mihajlosavkic you can see an exmaple here, or you can check the example in the code repo