mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-04 09:41:43 +08:00
[database][wip] refactor & improvements to add support for multiple apps
This commit is contained in:
@@ -24,6 +24,15 @@ const NATIVE_MODULE_EVENTS = {
|
||||
Auth: [
|
||||
'onAuthStateChanged',
|
||||
],
|
||||
Database: [
|
||||
'database_transaction_event',
|
||||
],
|
||||
};
|
||||
|
||||
const DEFAULTS = {
|
||||
Database: {
|
||||
persistence: false,
|
||||
},
|
||||
};
|
||||
|
||||
export default class ModuleBase {
|
||||
@@ -35,7 +44,7 @@ export default class ModuleBase {
|
||||
* @param withEventEmitter
|
||||
*/
|
||||
constructor(firebaseApp, options, moduleName, withEventEmitter = false) {
|
||||
this._options = Object.assign({}, options);
|
||||
this._options = Object.assign({}, DEFAULTS[moduleName] || {}, options);
|
||||
this._module = moduleName;
|
||||
this._firebaseApp = firebaseApp;
|
||||
this._appName = firebaseApp._name;
|
||||
|
||||
Reference in New Issue
Block a user