Add ability to pass meta to useLiveQuery and useLiveInfiniteQuery
#1129
ValenCassa
started this conversation in
Ideas
Replies: 1 comment
-
|
This feature would be so cool another suggestin would be queryMeta for passing extra values from a query doen into the hook like , parePage,nextCursor,totalCount... and this wuld just get over wrtten on every query where data.items is returned from the query and the reast and put in queryMeta to be accessed alongside data from the useLiveQuery i feel like it would nuke lots of the pagination issues people are having |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Allow passing custom metadata from query hooks (
useLiveQuery,useLiveInfiniteQuery, etc.) directly to a collection'squeryFn.Proposed API
Collection definition
Define a meta type as the third generic parameter:
Query usage
When using the collection, the
metaoption is typed based on what the collection expects:The same applies to
useLiveInfiniteQueryand other query hooks.Example: Passing filters
A common use case is passing filters to the collection's
queryFnfor server-side filtering. Note that you still need to construct thewhereclause for client-side evaluation - meta just provides a way to send data directly to the collection:Beta Was this translation helpful? Give feedback.
All reactions