-
Notifications
You must be signed in to change notification settings - Fork 48
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
Provide nice way to insert data during config #57
Comments
This actually represents a chicken & egg problem for the service. The upgrade callback gets called when you try and use the database for the first time. So it's a dependency of the $indexedDB service to do the upgrade, e.g. the promise won't give you the DB handle until this upgrade is finished. Which is nice, as it guarantees your schema will be in place. Probably you would need a broadcast even to make this possible. |
I suspect you would have to put the actual firing of the event itself in some kind of $timeout to actually allow the callstack to return. Seems simple enough but the devil is in the details. Have fun. |
That makes sense. Probably not worth the change. I think I could accomplish the what I want client side though if upgradeDatabase supported promises.
The contract is that if .upgradeDatabase returns a promise, the next upgrade won't happen until the promise is resolved. Would you accept something like that? |
Sure. Write the PR and it'll happen. |
Unless I'm reading this wrong, I think to insert data during config/upgrade time you need to go through the native objects, transactions, etc. It would be nice to get the same interface that $indexedDB.openStore gives you.
The text was updated successfully, but these errors were encountered: