-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for pagination #12
base: main
Are you sure you want to change the base?
Conversation
* @returns {Promise<ReturnObj>} | ||
*/ | ||
|
||
export const browseChannels = async ({page, limit}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we have readChannels(limit)
and browseChannels({page, limit}
.
How putting them together in readChannels({limit, page})
or readChannels(limit, page)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sounds cool too, passing an object sounds nice to me.
Also I keep thinking about this function here https://github.com/radio4000/components/blob/main/src/components/r4-list.js#L125-L146 where it allows all models to use the same function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example what if we browse "tracks" in a radio channel, and want to order them by title?
- do we want that?
- do we prefer having "just a search"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, these params (page
, limit
) will all be also bound to the URL, I guess this won't be in the sdk though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, let's change readChannels
then.
There must be many smart abstractions we can do. I feel for now we can experiment in r4-app by writing sdk.supabase.from()
queries directly? And once we know the patterns move them to the sdk.
Is this still relevant now that we have |
Adds:
utils.getBrowsePageParams()
→ can be used by all models, to get a paginated version of the resultschannel.browseChannels
→ an implementation for thechannels
modelMoved from: https://github.com/radio4000/components/blob/main/src/components/r4-list.js#L125-L146
The
web-component
version is currently more modular, as it allows all parameters passed to supabase to be customized from the web component attributes.