Skip to content

Commit b645ca0

Browse files
committed
make updateHook return the db object
1 parent 8dd13e5 commit b645ca0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/api.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
14621462
* the name of the database, the name of the table, and the row id of the
14631463
* changed row.
14641464
* - Set to `null` to unregister.
1465-
* @returns {void}
1465+
* @returns {Database} The database object. Useful for method chaining
14661466
*/
14671467
Database.prototype["updateHook"] = function updateHook(callback) {
14681468
if (this.updateHookFunctionPtr) {
@@ -1474,7 +1474,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
14741474

14751475
if (!callback) {
14761476
// no new callback to register
1477-
return;
1477+
return this;
14781478
}
14791479

14801480
// void(*)(void *,int ,char const *,char const *,sqlite3_int64)
@@ -1521,6 +1521,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
15211521
this.updateHookFunctionPtr,
15221522
0 // passed as the first arg to wrappedCallback
15231523
);
1524+
return this;
15241525
};
15251526

15261527
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy