47ng / nuqs

Type-safe search params state manager for React frameworks - Like useState, but stored in the URL query string.
https://nuqs.47ng.com
MIT License
4.86k stars 104 forks source link

doc: tanstack-table refactor pagination example code, and add sorting #748

Open acharlop opened 2 weeks ago

acharlop commented 2 weeks ago

I'm working on this now for my own project so figured I'd help out and add documentation.

Please let me know if this is helpful and heading in the right direction and I'll continue to add the filtering and a playground.

vercel[bot] commented 2 weeks ago

@acharlop is attempting to deploy a commit to the 47ng Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuqs ❌ Failed (Inspect) Nov 8, 2024 10:10am
franky47 commented 2 weeks ago

Thanks!

The idea behind community parsers is to highlight how to leverage custom parsers to represent data structures in the URL in a nice way. One thing you could try is to format the URL to only show the id and direction, like ?sort=name.asc or ?sort=age:desc.

The playground is an interactive way of configuring the parsers, variables here could include:

Does TanStack Table support sorting over multiple columns? Is this something we could support by combining it with parseAsArrayOf?