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

Reject promise for null values as an option? #111

Closed
scotttrinh opened this issue Jun 3, 2016 · 0 comments
Closed

Reject promise for null values as an option? #111

scotttrinh opened this issue Jun 3, 2016 · 0 comments
Assignees
Milestone

Comments

@scotttrinh
Copy link
Owner

I realize that localForage has taken the stance that looking up a non-existent key should resolve with null instead of reject with an error, but could we make this an optional thing? Maybe a second argument to getItem? I'd be happy to make a PR for it, if everyone likes the idea.

The biggest con is that it wouldn't work reliably if you want to retrieve the value null, but I don't plan on ever doing that in my use case, so... And, if we take the tack of making it a second, optional parameter on getItem, you can still retrieve null if you wanted to.

If not, I'm just going to wrap the $localForage service in my own service, so NBD if we don't want to deviate from localForage, but I thought I'd offer to push this upstream since it's a non-breaking change.

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

No branches or pull requests

1 participant