-
Notifications
You must be signed in to change notification settings - Fork 82
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
Pagination #111
Comments
I like the idea, but I don't think it is possible with the current API. I guess you could do something like this: Option 1 where "select next page" could be any text, and we implemented support for when choosing any item, you can either return true to actually select the value of the item. Or you could return a promise, which would then be expected to return a new list of items. This could be used for pagination up or down, or even more generically for some kind of arbitrarily deep folder structure. {
type: 'autocomplete',
name: 'fruit',
suggestOnly: true,
message: 'What is your favorite fruit?',
source: searchFood,
pageSize: 4,
selectItem: function (chosenValue) {
if (chosenValue === 'folder-pictures') {
return getSubFolder(chosenValue);
} else if (chosenValue === 'next-page') {
return getNextPage();
} else {
return true;
}
}
},
} Any thoughts? |
Off the top of your head, do you know if it would be possible to implement pagination when the user scrolls down far enough in the search results? Or is it impossible to get notified by
inquirer
that that's happened?I want to make helpers for selecting AWS resources, and it would be nice to be able to use AWS pagination.
On the other hand, I want to cache and immediately show recent selections while new results are being fetched, which probably isn't possible with this...maybe I should make my own thing that doesn't rely on
inquirer
...The text was updated successfully, but these errors were encountered: