Skip to content

Commit 5a13258

Browse files
committed
Add IDBDatabase.onclose
1 parent 9d3f4a6 commit 5a13258

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

api-reports/2_12.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14014,6 +14014,7 @@ IDBDatabase[JC] def dispatchEvent(evt: Event): Boolean
1401414014
IDBDatabase[JC] def name: String
1401514015
IDBDatabase[JC] def objectStoreNames: DOMStringList
1401614016
IDBDatabase[JC] var onabort: js.Function1[Event, _]
14017+
IDBDatabase[JC] var onclose: js.Function1[CloseEvent, _]
1401714018
IDBDatabase[JC] var onerror: js.Function1[Event, _]
1401814019
IDBDatabase[JC] var onversionchange: js.Function1[IDBVersionChangeEvent, _]
1401914020
IDBDatabase[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit

api-reports/2_13.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14014,6 +14014,7 @@ IDBDatabase[JC] def dispatchEvent(evt: Event): Boolean
1401414014
IDBDatabase[JC] def name: String
1401514015
IDBDatabase[JC] def objectStoreNames: DOMStringList
1401614016
IDBDatabase[JC] var onabort: js.Function1[Event, _]
14017+
IDBDatabase[JC] var onclose: js.Function1[CloseEvent, _]
1401714018
IDBDatabase[JC] var onerror: js.Function1[Event, _]
1401814019
IDBDatabase[JC] var onversionchange: js.Function1[IDBVersionChangeEvent, _]
1401914020
IDBDatabase[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit

dom/src/main/scala/org/scalajs/dom/IDBDatabase.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ class IDBDatabase extends EventTarget {
3434
/** A DOMStringList that contains a list of the names of the object stores currently in the connected database. */
3535
def objectStoreNames: DOMStringList = js.native
3636

37+
/** The onclose event handler of the IDBDatabase interface handles the close event, which is fired when the database
38+
* is unexpectedly closed. This can happen, for example, when the application is shut down or access to the disk the
39+
* database is stored on is lost while the database is open.
40+
*
41+
* The close event is fired after all transactions have been aborted and the connection has been closed.
42+
*/
43+
var onclose: js.Function1[CloseEvent, _] = js.native
44+
3745
/** Fires when access to the database fails. */
3846
var onerror: js.Function1[Event, _] = js.native
3947

0 commit comments

Comments
 (0)