Add .clear() to map-likes #129

Open
marcoscaceres opened this Issue Apr 13, 2017 · 5 comments

Comments

Projects
None yet
2 participants
Member

marcoscaceres commented Apr 13, 2017

It be useful to have a clear() method for interfaces that store things.

@ianbjacobs ianbjacobs added a commit that referenced this issue Apr 13, 2017

@ianbjacobs ianbjacobs Respec fixes (#126)
chore: clean up markup and xrefs

Also:
* Added clear() method for both instruments and wallets; removed
example that achieved clear in other ways. See issue 129
 #129
* For keys(), mentioned original insertion order
* Added issue marker 128 for examples to be revisited
a3f5482
Contributor

ianbjacobs commented Apr 13, 2017

Hi @marcoscaceres,

With AdamR's guidance we added clear() methods for wallets and instruments along with other edits to align with your comments (which were mostly respect and xref fixes).

https://w3c.github.io/webpayments-payment-apps-api/#clear-method
https://w3c.github.io/webpayments-payment-apps-api/#clear-method-1

Ian

Contributor

ianbjacobs commented May 8, 2017

@marcoscaceres, does the current draft of the spec address your isssue?

Ian

Member

marcoscaceres commented May 9, 2017

Sort of, but not really (again, seems things were added in a rush to go to FPWD without wide review😢)...

Why do we have two interfaces with identical method signatures? We should just have a single AsyncDataStore interface for PaymentWallets and PaymentInstruments. That is:

    readonly attribute AsyncDataStore instruments;
    readonly attribute AsyncDataStore wallets;

We should really be talking to the IDB folks and aligning here on an interface.

What is currently there is not clear because there is no real transactional semantics for what happens if:

Promise.all([x.add("1"), x.clear(), x.add("2")]); 

As they all run in parallel without an associated task queue.

Contributor

ianbjacobs commented May 9, 2017

Great comments.

I found this link to the IDB editors' draft:
http://w3c.github.io/IndexedDB/

I'm happy to take an action to talk to them about alignment.

Ian

Member

marcoscaceres commented May 10, 2017

Would be good. We need a primitive that is an domain specific database, but with a common interface that looks a lot like an (async) map. We have also the Cache API for precedence here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment