- From: Jake Archibald <notifications@github.com>
- Date: Fri, 06 Jan 2017 01:25:37 -0800
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 6 January 2017 09:26:13 UTC
jakearchibald commented on this pull request.
> +the database.
+
+<pre class=lang-javascript>
+db.onversionchange = function() {
+ // First, save any unsaved data:
+ saveUnsavedData().then(function() {
+ // Now you need to close the database.
+ // If the document isn't being actively used, it may be appropriate to reload:
+ if (!document.hasFocus()) {
+ location.reload();
+ // Reloading will close the database, and also reload with the new JavaScript
+ // and database definitions.
+ } else {
+ // Alternatively you may close the database and display a message to the
+ // user. You need to ensure this isn't a disruptive user experience.
+ db.close();
I'll make a reference to the onclose event.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/pull/133
Received on Friday, 6 January 2017 09:26:13 UTC