[functions][js] start of functions implementationn

This commit is contained in:
Salakar 2018-05-04 08:37:30 +01:00
parent 19266d4bae
commit 8dee086f1f
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
/**
* @flow
* Functions representation wrapper
*/
import ModuleBase from '../../utils/ModuleBase';
import { getNativeModule } from '../../utils/native';
import type App from '../core/app';
export const MODULE_NAME = 'RNFirebaseFunctions';
export const NAMESPACE = 'functions';
type HttpsCallable = (data?: any) => Promise<any>;
export default class Analytics extends ModuleBase {
constructor(app: App) {
super(app, {
moduleName: MODULE_NAME,
multiApp: false,
hasShards: false,
namespace: NAMESPACE,
});
}
/**
* Returns a reference to the callable https trigger with the given name.
* @param name The name of the trigger.
*/
httpsCallable(name: string): HttpsCallable {
return (data?: any) => getNativeModule(this).httpsCallable(name, data);
}
}
export const statics = {};