mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-23 20:10:05 +08:00
[js] move auth statics
This commit is contained in:
@@ -8,7 +8,7 @@ import Log from './utils/log';
|
||||
import { isObject } from './utils';
|
||||
|
||||
// modules
|
||||
import Auth from './modules/auth';
|
||||
import Auth, { statics as AuthStatics } from './modules/auth';
|
||||
import Storage, { statics as StorageStatics } from './modules/storage';
|
||||
import Database, { statics as DatabaseStatics } from './modules/database';
|
||||
import Messaging from './modules/messaging';
|
||||
@@ -54,8 +54,12 @@ export default class Firebase {
|
||||
throw new Error(`Google Play Services is required to run this application but no valid installation was found (Code ${this.googleApiAvailability.status}).`);
|
||||
}
|
||||
|
||||
this.auth = this._staticsOrInstance('auth', StorageStatics, Auth);
|
||||
this.storage = this._staticsOrInstance('storage', StorageStatics, Storage);
|
||||
this.database = this._staticsOrInstance('database', DatabaseStatics, Database);
|
||||
|
||||
// init auth to stat listeners
|
||||
this.auth();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,10 +85,6 @@ export default class Firebase {
|
||||
return instances[name];
|
||||
}
|
||||
|
||||
auth() {
|
||||
return this._auth;
|
||||
}
|
||||
|
||||
analytics() {
|
||||
if (!this._analytics) {
|
||||
this._analytics = new Analytics(this);
|
||||
|
||||
Reference in New Issue
Block a user