W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2014

Re: IDBObjectStore/IDBIndex.exists(key)

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 23 Jun 2014 13:28:30 -0700
Message-ID: <CA+c2ei-9Qj8w0xzYhKg8sqghNPHLoR9GHg9DMycePyL0bnV02g@mail.gmail.com>
To: Marc Fawzi <marc.fawzi@gmail.com>
Cc: Joshua Bell <jsbell@google.com>, ben turner <bent.mozilla@gmail.com>, Webapps WG <public-webapps@w3.org>
On Mon, Jun 23, 2014 at 1:03 PM, Marc Fawzi <marc.fawzi@gmail.com> wrote:
> Having said that, and speaking naively here, a synchronous .exists() or .contains() would be useful as "existence" checks shouldn't have to be exclusively asynchronous as that complicates how we'd write: "if this exists and that other thing doesn't exists then do xyz"

Note that the .contains() discussion is entirely separate from the
.exists() discussion. I.e. your subject is entirely off-topic to this
thread.

The .exists() function I proposed lives on IDBObjectStore and IDBIndex
and is an asynchronous database operation.

The .contains() function that you are talking about lives on an
array-like object and just does some in-memory tests which means that
it's synchronous.

So the two are completely unrelated.

/ Jonas
Received on Monday, 23 June 2014 20:29:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:25 UTC