- From: Jake Archibald <notifications@github.com>
- Date: Fri, 04 Oct 2019 03:50:11 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 4 October 2019 10:50:34 UTC
We could add `getClientData`, but I wonder if it would encourage racing:
```js
clients.getClientData().then(data => {
data.hello = 'world';
clients.setClientData(data);
});
// …
clients.getClientData().then(data => {
data.foo = 'baz';
clients.setClientData(data);
});
```
We could ask folks to use weblocks, but if they're going to do coordination like that, they may as well just coordinate on a state object.
```js
import stateData from './state.mjs';
stateData.hello = 'world';
clients.setClientData(stateData);
// …
stateData.foo = 'baz';
clients.setClientData(stateData);
```
--
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/1475#issuecomment-538348980
Received on Friday, 4 October 2019 10:50:34 UTC