Re: [w3c/ServiceWorker] Pagination in cache.keys() (#1066)

Thanks @wanderview, I've updated the test here: https://rawgit.com/ConradIrwin/a634359060cbbde0e90a30e5744aa1a1/raw/94c524dcc451f7104b5fdf8999a56cc70db86ff2/storage.html (the time was actually less of a concern for me, as it's a relatively rare async event, the crash was the big problem in chrome).

@jakearchibald What does that syntax desugar to? In general happy to manually iterate over the collection, but the API doesn't support that yet.

```js
function paginate(cache, callback, offset) {
  return cache.keys(null, {limit: 1000, offset: offset || 0}).then((keys) =>
    for (key in keys) {
      callback(key);
    }
    if (keys.length === 1000) {
      return paginate(cache, callback, offset + 1000)
    }
  }
}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1066#issuecomment-277384883

Received on Friday, 3 February 2017 22:54:12 UTC