Skip to content

Commit

Permalink
- Add missing close function on the javascript side of the bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrodriguez committed Nov 27, 2015
1 parent 2568343 commit 8b5d08c
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions index.android.js
Expand Up @@ -53,22 +53,20 @@ var Sqlite = {
});
},

storeEvent: function(
sql: string,
params: Array<?(number|string)>,
callback?: ?(error: ?Error, result: ?string) => void
): Promise {
return new Promise((resolve, reject) => {
DBManager.execute(sql, params, function(errors, result) {
callback && callback((errors && convertError(errors[0])) || null, result);
if (errors) {
reject(convertError(errors[0]));
} else {
resolve(result)
}
});
});
}
close: function(
callback?: ?(error: ?Error, result: ?string) => void
): Promise {
return new Promise((resolve, reject) => {
DBManager.close(function(errors, result) {
callback && callback((errors && convertError(errors[0])) || null, result);
if (errors) {
reject(convertError(errors[0]));
} else {
resolve(result)
}
});
});
},
}

function convertError(error) {
Expand Down

0 comments on commit 8b5d08c

Please sign in to comment.