Re: [w3c/ServiceWorker] Provide a simple synchronous k-v storage for ServiceWorker? (#981)

OK, given `await` is coming, I agree that being synchronous isn't that important. And OK, I wasn't aware that IDB is available in Service Workers, so given there is that, it's probably fine.

(I personally wouldn't choose IDB for my case... I feel that it is probably easier to write a wrapper around Cache API to provide k-v storage, actually. I'm just not a fan of using external libs :)

> I agree with 2 in general, but we're talking < 500 bytes here.

Many things added in standards can be implemented with even fewer bytes.

For example, the recent added (and implemented) `once` option for `EventTarget.addEventListener` can actually be implemented in a four line JavaScript function, but I still think adding that to the spec is a good thing, because that makes me no longer need to care about importing a right util module or writing that function every time when I need it.

@asutherland The lite IDB looks easier to use, though I might probably still argue it is more complicated than a k-v storage for e.g. having store object and index. I have no idea where the trade-off between easy to use and powerful enough should be.

-- 
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/981#issuecomment-249424981

Received on Sunday, 25 September 2016 14:33:09 UTC