initial commit

This commit is contained in:
Ben Styles 2017-05-10 17:37:03 +01:00
parent ce8a49f026
commit 477bd2bf54
2 changed files with 11 additions and 3 deletions

View File

@ -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) => {

View File

@ -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];