{"action":"created","issue":{"url":"https://api.github.com/repos/JedWatson/react-select/issues/1237","repository_url":"https://api.github.com/repos/JedWatson/react-select","labels_url":"https://api.github.com/repos/JedWatson/react-select/issues/1237/labels{/name}","comments_url":"https://api.github.com/repos/JedWatson/react-select/issues/1237/comments","events_url":"https://api.github.com/repos/JedWatson/react-select/issues/1237/events","html_url":"https://github.com/JedWatson/react-select/pull/1237","id":178448490,"number":1237,"title":"feat(pagination): add async pagination","user":{"login":"TheSharpieOne","id":664714,"avatar_url":"https://avatars.githubusercontent.com/u/664714?v=3","gravatar_id":"","url":"https://api.github.com/users/TheSharpieOne","html_url":"https://github.com/TheSharpieOne","followers_url":"https://api.github.com/users/TheSharpieOne/followers","following_url":"https://api.github.com/users/TheSharpieOne/following{/other_user}","gists_url":"https://api.github.com/users/TheSharpieOne/gists{/gist_id}","starred_url":"https://api.github.com/users/TheSharpieOne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheSharpieOne/subscriptions","organizations_url":"https://api.github.com/users/TheSharpieOne/orgs","repos_url":"https://api.github.com/users/TheSharpieOne/repos","events_url":"https://api.github.com/users/TheSharpieOne/events{/privacy}","received_events_url":"https://api.github.com/users/TheSharpieOne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-21T20:02:02Z","updated_at":"2016-10-13T08:32:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JedWatson/react-select/pulls/1237","html_url":"https://github.com/JedWatson/react-select/pull/1237","diff_url":"https://github.com/JedWatson/react-select/pull/1237.diff","patch_url":"https://github.com/JedWatson/react-select/pull/1237.patch"},"body":"This checks the first box in [this list for v1.0.0](https://github.com/JedWatson/react-select/issues/568#issuecomment-153785740) and closes #644\r\n\r\nThis adds a new `pagination` prop to the `Select.Aync` component. It is a boolean which is `false` by default (`false`: things act as they did before it was added). When `pagination` is `true` `loadOptions` is given an additional argument; `page`.\r\n`page` tells the user's `loadOptions` function which page to load (they can use to when building their request). Additional page results are appended to the options list. Changing the input value will reset the page back to `1`.\r\n`loadOptions` is called when the user scrolls to the bottom of the menu list, trigger the next page of results to be appended.\r\nCaching is used! (Cache all the things!). If a user scrolls down enough to load additional pages, then changes the input (triggering new requests), then enters the original input, all of the pages for the original input will be loaded back and when the user scroll to the bottom again, it will pick up on the page it left off on.\r\n\r\nDocumentation has been updated to reflect the new prop and how it affects loadOptions' signature."},"comment":{"url":"https://api.github.com/repos/JedWatson/react-select/issues/comments/253449253","html_url":"https://github.com/JedWatson/react-select/pull/1237#issuecomment-253449253","issue_url":"https://api.github.com/repos/JedWatson/react-select/issues/1237","id":253449253,"user":{"login":"lucaas","id":186534,"avatar_url":"https://avatars.githubusercontent.com/u/186534?v=3","gravatar_id":"","url":"https://api.github.com/users/lucaas","html_url":"https://github.com/lucaas","followers_url":"https://api.github.com/users/lucaas/followers","following_url":"https://api.github.com/users/lucaas/following{/other_user}","gists_url":"https://api.github.com/users/lucaas/gists{/gist_id}","starred_url":"https://api.github.com/users/lucaas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucaas/subscriptions","organizations_url":"https://api.github.com/users/lucaas/orgs","repos_url":"https://api.github.com/users/lucaas/repos","events_url":"https://api.github.com/users/lucaas/events{/privacy}","received_events_url":"https://api.github.com/users/lucaas/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T08:32:40Z","updated_at":"2016-10-13T08:32:40Z","body":"Thank you for your contribution, we would love pagination support for react-select.\r\n\r\nOur API works with an `offset` parameter which is returned with the payload (as `next_offset`). This can not be simply calculated from a page argument (`offset = page * pageSize`), as items may be culled from the returned result.\r\n\r\nWe would like to save the `next_offset` value, and pass that in to `loadOptions`. Could this use case be supported?"}}
{"actor":{"display_login":"lucaas"}}