From 477bd2bf54d08a40d5de226b88e4f201379f3fa9 Mon Sep 17 00:00:00 2001 From: Ben Styles Date: Wed, 10 May 2017 17:37:03 +0100 Subject: [PATCH] initial commit --- lib/modules/database/reference.js | 12 ++++++++++-- lib/utils/index.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/modules/database/reference.js b/lib/modules/database/reference.js index 50fff25d..d0eadd0c 100644 --- a/lib/modules/database/reference.js +++ b/lib/modules/database/reference.js @@ -375,8 +375,16 @@ export default class Reference extends ReferenceBase { * @param onComplete * @param applyLocally */ - transaction(transactionUpdate: Function, onComplete: (?Error, boolean, ?Snapshot) => *, applyLocally: boolean = false) { - if (!isFunction(transactionUpdate)) return Promise.reject(new Error('Missing transactionUpdate function argument.')); + transaction( + transactionUpdate: Function, + onComplete: (error: ?Error, committed: boolean, snapshot: ?Snapshot) => *, + applyLocally: boolean = false + ) { + if (!isFunction(transactionUpdate)) { + return Promise.reject( + new Error('Missing transactionUpdate function argument.') + ); + } return new Promise((resolve, reject) => { const onCompleteWrapper = (error, committed, snapshotData) => { diff --git a/lib/utils/index.js b/lib/utils/index.js index bedb5a48..bb957a69 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -165,7 +165,7 @@ export function promisify( fn: Function | string, NativeModule: Object, errorPrefix?: string -): (any) => Promise<> { +): (args: any) => Promise<> { return (...args) => { return new Promise((resolve, reject) => { const _fn = typeof fn === 'function' ? fn : NativeModule[fn];