react-native-firebase-compiled
Version:
A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto
56 lines (41 loc) • 1.37 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _log = require("./log");
var _native = require("./native");
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
class ModuleBase {
/**
*
* @param app
* @param config
* @param customUrlOrRegion
*/
constructor(app, config, customUrlOrRegion) {
_defineProperty(this, "_app", void 0);
_defineProperty(this, "_customUrlOrRegion", void 0);
_defineProperty(this, "namespace", void 0);
if (!config.moduleName) {
throw new Error('Missing module name');
}
if (!config.namespace) {
throw new Error('Missing namespace');
}
const moduleName = config.moduleName;
this._app = app;
this._customUrlOrRegion = customUrlOrRegion;
this.namespace = config.namespace; // check if native module exists as all native
(0, _native.initialiseNativeModule)(this, config, customUrlOrRegion);
(0, _log.initialiseLogger)(this, `${app.name}:${moduleName.replace('RNFirebase', '')}`);
}
/**
* Returns the App instance for current module
* @return {*}
*/
get app() {
return this._app;
}
}
exports.default = ModuleBase;
;