tsironis / lockr

A minimal API wrapper for localStorage
MIT License
815 stars 79 forks source link

Trying Lockr.sadd throws values.indexOf error #18

Closed cfjedimaster closed 9 years ago

cfjedimaster commented 9 years ago

I tried a simple sadd example:

Lockr.sadd("testS", 1);

And I get this in console:

Uncaught TypeError: values.indexOf is not a function

cfjedimaster commented 9 years ago

If I do this first: Lockr.set("testS", []);

it works, but shouldn't sadd recognize the se doesn't exist and just default it?

tsironis commented 9 years ago

Thanks for bringing this to our attention!

Lockr.sadd uses smembers under the hood, which already returns an empty array, so you shouldn't get this error.

Also, specs are passing in major browsers. What browser are you using?

cfjedimaster commented 9 years ago

Latest Chrome.

On Fri, Jul 24, 2015 at 4:47 AM, Dimitris Tsironis <notifications@github.com

wrote:

Thanks for bringing this to our attention!

Lockr.sadd uses smembers under the hood, which already returns an empty array, so you shouldn't get this error.

Also, specs are passing in major browsers. What browser are you using?

— Reply to this email directly or view it on GitHub https://github.com/tsironis/lockr/issues/18#issuecomment-124458538.

Raymond Camden, Developer Advocate for MobileFirst at IBM

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: raymondcamden

tsironis commented 9 years ago
screen shot 2015-07-27 at 2 01 54 pm

I could not reproduce the issue (please see screenshot above). Can you provide any additional details to reproduce?

cfjedimaster commented 9 years ago

Weird - I've tried to recreate it and can't anymore. I wonder if maybe I had a testS value already or.... I don't know. Either way - sorry for the noise.

tsironis commented 9 years ago

No worries, mate! If you manage to reproduce, please don't hesitate to send me more details.