initial commit
This commit is contained in:
parent
ce8a49f026
commit
477bd2bf54
|
@ -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) => {
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue