mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
[internals] Start refactoring some of the internals to simplify, tidy up and also reduce flow type pollution
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user