[slightlyoff/ServiceWorker] need AsyncLocalStorage (was #904) (#906)

localStorage is handy for much usecases, but unfortunately it's api based on Sync.
so in service worker we need to use Indexed DB for every kind of data, only if you need to store 1byte flag.

I think if we don't need index for large data search, and don't wanna preparing ceremony for storing data,
it's better to have a localStorage witch having Async API.

or other sight of view, Cache API is much handy than IDB, but it's specialised for Request/Response.
AsyncLocalStorage will looks something like CacheAPI witch is generalised for generic javascript object.
(we may say it as parent class of Cache API class)

this will solve may use case I think, for example..

- every use case for localStorage at window context
- saving request data for sync event (I described it at #904)
- saving simple/single/small data like flag, counter etc
- case for preparing scheme at install/activate are over kill

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/906

Received on Tuesday, 31 May 2016 08:05:03 UTC