-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(setDriver): try the next driver if _initStorage fails #448
Conversation
feat(localforage.setDriver): try the first driver directly feat(localforage.setDriver): wait for any pending older driver initialization refactor(localforage.setDriver): remove the outer promise in favor of chaining fix(localforage.setDriver): wrap LibaryMethods with ready() refactor(localforage.ready): remove the outer promise in favor of chaining
callWhenReady(this, LibraryMethods[i]); | ||
} | ||
|
||
this._wrapLibraryMethodsWithReady(); |
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.
Abstract into a separate method
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.
👍
self._ready = null; | ||
function initDriver(supportedDrivers) { | ||
return function() { | ||
var crntDriverPos = 0; |
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.
I'm going to rename this to currentDriverPosition
; we have the bytes to spare 😉
Sorry this took me ages; I'm very behind on localForage work. All good; I'll tweak that variable name and merge it in now 👍 |
It took me a lot of time to write and some iterations & refactors to bring the code to its final state. So I guess that the time required for reviewing was expected given the complexity & effort. |
Resolves #363
Possibly related to #70, #145, #195
Squashed commits :
feat(localforage.setDriver): try the first driver directly
feat(localforage.setDriver): wait for any pending older driver initialization
refactor(localforage.setDriver): remove the outer promise in favor of chaining
fix(localforage.setDriver): wrap LibaryMethods with ready()
refactor(localforage.ready): remove the outer promise in favor of chaining