Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 fixes #16

Merged
merged 2 commits into from
Aug 8, 2015
Merged

2 fixes #16

merged 2 commits into from
Aug 8, 2015

Conversation

Diablohu
Copy link
Contributor

support for getting non-Lockr value

if someone stored some value before using Lockr, that value can now be getting by using Lockr.get()

can now get value that equals 0 or false

if use Lockr.get(key, defaultValue) and the stored value is 0 or false, the result is defaultValue, not 0 or false. this will fix it.

* also can now get value that equals 0 or false
@tsironis
Copy link
Owner

tsironis commented Aug 5, 2015

@Diablohu Can you add related specs for this PR so we can merge it?

@Diablohu
Copy link
Contributor Author

Diablohu commented Aug 5, 2015

just fix/modified Lockr.get() function for the 2 fixes mentioned above, for I encountered 2 problems when using Lockr in an exist product

Problem 1: when using Lockr.get() to retrieve an exist localStorage value, an error encountered

Problem 2: if a value is 0 or false, when retrieve using Lockr.get(), it returns as a missing value

@tsironis
Copy link
Owner

tsironis commented Aug 5, 2015

@Diablohu I mean, can you add tests in the lockrSpecs.js file that test your code?

@Diablohu
Copy link
Contributor Author

Diablohu commented Aug 7, 2015

specs added

tsironis added a commit that referenced this pull request Aug 8, 2015
support for getting non-Lockr value & support for falsy values
@tsironis tsironis merged commit 491dab3 into tsironis:master Aug 8, 2015
@tsironis
Copy link
Owner

tsironis commented Aug 8, 2015

Awesome work! Thanks for the contribution 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants