Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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+
returnthis;
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)

AltStyle によって変換されたページ (->オリジナル) /