[internals] Start refactoring some of the internals to simplify, tidy up and also reduce flow type pollution

This commit is contained in:
Chris Bianca
2017-12-22 15:24:31 +00:00
parent 1a35d8a7b5
commit f2c2007fdc
30 changed files with 563 additions and 610 deletions

View File

@@ -2,6 +2,7 @@
* @flow
* Remote Config representation wrapper
*/
import { getLogger } from '../../utils/log';
import ModuleBase from './../../utils/ModuleBase';
import type FirebaseApp from '../core/firebase-app';
@@ -51,7 +52,7 @@ export default class RemoteConfig extends ModuleBase {
*/
enableDeveloperMode() {
if (!this._developerModeEnabled) {
this.log.debug('Enabled developer mode');
getLogger(this).debug('Enabled developer mode');
this._native.enableDeveloperMode();
this._developerModeEnabled = true;
}
@@ -64,10 +65,10 @@ export default class RemoteConfig extends ModuleBase {
*/
fetch(expiration?: number) {
if (expiration !== undefined) {
this.log.debug(`Fetching remote config data with expiration ${expiration.toString()}`);
getLogger(this).debug(`Fetching remote config data with expiration ${expiration.toString()}`);
return this._native.fetchWithExpirationDuration(expiration);
}
this.log.debug('Fetching remote config data');
getLogger(this).debug('Fetching remote config data');
return this._native.fetch();
}
@@ -78,7 +79,7 @@ export default class RemoteConfig extends ModuleBase {
* rejects if no Fetched Config was found, or the Fetched Config was already activated.
*/
activateFetched() {
this.log.debug('Activating remote config');
getLogger(this).debug('Activating remote config');
return this._native.activateFetched();
}