[js] move auth statics

This commit is contained in:
Salakar
2017-03-27 19:11:26 +01:00
parent 2ae3003597
commit 86512320f0
2 changed files with 13 additions and 12 deletions

View File

@@ -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);