Re: [w3ctag/design-reviews] Cookie Store API (#469)

@ayuishii 

> ```
> let cookie = await cookieStore.get(cookieName);
> cookie.expires = new Date('Wed, 1 Jan 2025 00:00:00 GMT');
> cookieStore.set(cookie); 
> ```

how does that work?

```
  Promise<CookieListItem?> get(USVString name);
  Promise<CookieListItem?> get(optional CookieStoreGetOptions options = {});
```
await + get returns a CookieListItem, so cookie will be of that type,

```
  Promise<void> set(USVString name, USVString value,
                    optional CookieStoreSetOptions options = {});
  Promise<void> set(CookieStoreSetExtraOptions options);
```

But there is no `set` that takes a `CookieListItem`? 

> However, we defer to your expertise on API ergonomics. If there are other variants of `set` that are preferred, please show us the way! We would be happy to adopt your recommendation.

Your code example above makes a lot of sense, but I just don't see how it would work with the specced API



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/469#issuecomment-633873003

Received on Tuesday, 26 May 2020 08:02:45 UTC