Merge pull request #106 from Leeds-eBooks/patch/flow-errors-3
Revert to old flow syntax (always named function arguments)
This commit is contained in:
commit
c7eb09ddd5
|
@ -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