Re: [IndexedDB] Behavior of IDBObjectStore.get() and IDBObjectStore.delete() when record doesn't exist

I was only suggesting this as it makes the operations symmetrical in the
sense that if "get" returns undefined for "key does not exist",
"put(undefined, key)" should mean make this key not exist, in a declarative
sense.

For me this is clearer than the alternatives (which may require exceptions
to deal with some cases).

Of course its only a suggestion, and it nobody likes it, feel free to ignore
it.


Cheers,
Keean.


On 8 November 2010 18:57, Keean Schupke <keean@fry-it.com> wrote:

> Hi,
>
>
>> Indeed. But I think this is more unexpected and confusing than having
>> .get() return the same thing if the entry exists as if it contains
>> undefined.
>>
>> / Jonas
>>
>
> I don't understand that.
>
> with the proposal, undefined clearly means the entry does not exist as
> there is no way to put an undefined into the object store (as
> .put(undefined, key) deletes the entry).
>
>
> Cheers,
> Keean.
>
>

Received on Monday, 8 November 2010 19:22:05 UTC