fetchAllItems = async ({ fetchPage, commonParams, selectItems, getNextPageParams }) => {
  const firstPage = await fetchPage(commonParams).promise()
  const items = [...selectItems(firstPage)]
  let nextPageParams = getNextPageParams(firstPage)
  while (nextPageParams) {
    const page = await fetchPage({
      ...commonParams,
      ...nextPageParams
    }).promise()
    items.push(...selectItems(page))
    nextPageParams = getNextPageParams(page)
  }
  return items
}
Returns an array of all items across pages.

 - The `fetchPage` function may accept a "fetch parameters" object and must
   return a Promise resolving to "page data".
 - The `commonParams` object represents "fetch parameters" which are passed
   to every `fetchPage` call.
 - The `selectItems` function must accept "page data" and must return an
   iterable of the page's items.
 - The `getNextPageParams` function may accept "page data" and must return
   either:
   - a "fetch parameters" object which will be merged with `commonParams` on
     the next call to `fetchPage`, indicating that there is a next page to
     fetch; or
   - a falsy value, to indicate that no next page should be fetched.