@@ -98,7 +98,7 @@ The test files provide up to date example of the use of the api.
98
98
` SQL.Database ` constructor takes an array of integer representing a database file as an optional parameter.
99
99
The following code uses an HTML input as the source for loading a database:
100
100
``` javascript
101
- dbFileElm .onchange = function () {
101
+ dbFileElm .onchange = () => {
102
102
var f = dbFileElm .files [0 ];
103
103
var r = new FileReader ();
104
104
r .onload = function () {
@@ -117,7 +117,7 @@ var xhr = new XMLHttpRequest();
117
117
xhr .open (' GET' , ' /path/to/database.sqlite' , true );
118
118
xhr .responseType = ' arraybuffer' ;
119
119
120
- xhr .onload = function ( e ) {
120
+ xhr .onload = e => {
121
121
var uInt8Array = new Uint8Array (this .response );
122
122
var db = new SQL.Database (uInt8Array);
123
123
var contents = db .exec (" SELECT * FROM my_table" );
@@ -165,9 +165,9 @@ Example:
165
165
``` html
166
166
<script >
167
167
var worker = new Worker (" js/worker.sql.js" ); // You can find worker.sql.js in this repo
168
- worker .onmessage = function () {
168
+ worker .onmessage = () => {
169
169
console .log (" Database opened" );
170
- worker .onmessage = function ( event ) {
170
+ worker .onmessage = event => {
171
171
console .log (event .data ); // The result of the query
172
172
};
173
173
@@ -178,7 +178,7 @@ Example:
178
178
});
179
179
};
180
180
181
- worker .onerror = function ( e ) { console .log (" Worker error: " , e)} ;
181
+ worker .onerror = e => console .log (" Worker error: " , e);
182
182
worker .postMessage ({
183
183
id: 1 ,
184
184
action: ' open' ,
0 commit comments