-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
(#1191) - Lazy openDB() #1192
(#1191) - Lazy openDB() #1192
Conversation
we probably don't need to worry about somebody not passing arguments, so we can skip the arguments length check. we also want to use as context for the apply as whatever it turns out to be, i.e. window, window. sqlitePlugin or navigator.sqlitePlugin. lastly we want to return the results of the function, not the function itself which means we would probably need a separate check for validity. |
That's actually how I did it first (before a6c5143), but then I suspected it might throw in the |
we can actually probably revert the validity test to what it was before I added the sqlite plugin |
Allright, I went back to the proper scope and a more explicit validity test, like it was before the sqlite plugin check, but more... |
} | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can just return undefined, aka remove this line
I rebased, squashed the commits into 1 and fixed the commit message merged it, going forward it would be helpful if you could make sure you have only one commit and that the message be in the format '(#issue number) - message.' If you aren't familiar enough with git to be able to do that to a commit like this, then just do the pull like this one and I can walk you through fixing it. Seriously though thanks for this patch. |
No problem @calvinmetcalf, I'm quite familiar with git but I figured I'd squash when "LGTM". Anyway glad I can help out, really like the way PouchDB is going right now. |
To fix #1191 this PR makes the openDatabase check lazy so it will be able to find the sqlite plugin.