[config] rename cacheExpirationSeconds arg to expirationDurationSeconds

[skip ci]
This commit is contained in:
Salakar
2019-05-22 21:01:01 +01:00
parent 682e549b71
commit b2d3fc1f08
3 changed files with 18 additions and 18 deletions

View File

@@ -219,9 +219,9 @@ export namespace Config {
* await firebase.config().fetch(300);
* ```
*
* @param cacheExpirationSeconds Duration in seconds to cache the data for. To skip cache, use a duration of 0.
* @param expirationDurationSeconds Duration in seconds to cache the data for. To skip cache, use a duration of 0.
*/
fetch(cacheExpirationSeconds?: number): Promise<null>;
fetch(expirationDurationSeconds?: number): Promise<null>;
/**
* Fetches the remote config data from Firebase, as defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration.
@@ -241,9 +241,9 @@ export namespace Config {
* }
* ```
*
* @param cacheExpirationSeconds Duration in seconds to cache the data for. To skip cache use a duration of 0.
* @param expirationDurationSeconds Duration in seconds to cache the data for. To skip cache use a duration of 0.
*/
fetchAndActivate(cacheExpirationSeconds?: number): Promise<boolean>;
fetchAndActivate(expirationDurationSeconds?: number): Promise<boolean>;
/**
* Retrieve the configuration settings and status for Remote Config.

View File

@@ -92,36 +92,36 @@ class FirebaseConfigModule extends FirebaseModule {
/**
* Fetches parameter values for your app.
* @param {number} cacheExpirationSeconds
* @param {number} expirationDurationSeconds
* @returns {Promise}
*/
fetch(cacheExpirationSeconds) {
if (!isUndefined(cacheExpirationSeconds) && !isNumber(cacheExpirationSeconds)) {
fetch(expirationDurationSeconds) {
if (!isUndefined(expirationDurationSeconds) && !isNumber(expirationDurationSeconds)) {
throw new Error(
`firebase.config().fetch(): 'cacheExpirationSeconds' must be a number value.`,
`firebase.config().fetch(): 'expirationDurationSeconds' must be a number value.`,
);
}
return this.native.fetch(
cacheExpirationSeconds !== undefined ? cacheExpirationSeconds : -1,
expirationDurationSeconds !== undefined ? expirationDurationSeconds : -1,
false,
);
}
/**
* TODO(salakar) return boolean always?
* @param cacheExpirationSeconds
* @param expirationDurationSeconds
* @returns {Promise|never|Promise<Response>}
*/
fetchAndActivate(cacheExpirationSeconds) {
if (!isUndefined(cacheExpirationSeconds) && !isNumber(cacheExpirationSeconds)) {
fetchAndActivate(expirationDurationSeconds) {
if (!isUndefined(expirationDurationSeconds) && !isNumber(expirationDurationSeconds)) {
throw new Error(
`firebase.config().fetchAndActivate(): 'cacheExpirationSeconds' must be a number value.`,
`firebase.config().fetchAndActivate(): 'expirationDurationSeconds' must be a number value.`,
);
}
return this.native.fetch(
cacheExpirationSeconds !== undefined ? cacheExpirationSeconds : -1,
expirationDurationSeconds !== undefined ? expirationDurationSeconds : -1,
true,
);
}

View File

@@ -166,9 +166,9 @@ export interface Module extends ReactNativeFirebaseModule {
* await firebase.config().fetch(300);
* ```
*
* @param cacheExpirationSeconds Duration in seconds to cache the data for. To skip cache, use a duration of 0.
* @param expirationDurationSeconds Duration in seconds to cache the data for. To skip cache, use a duration of 0.
*/
fetch(cacheExpirationSeconds?: number): Promise<null>;
fetch(expirationDurationSeconds?: number): Promise<null>;
/**
* Fetches the remote config data from Firebase, as defined in the dashboard. If duration is defined (seconds), data will be locally cached for this duration.
@@ -188,9 +188,9 @@ export interface Module extends ReactNativeFirebaseModule {
* }
* ```
*
* @param cacheExpirationSeconds Duration in seconds to cache the data for. To skip cache use a duration of 0.
* @param expirationDurationSeconds Duration in seconds to cache the data for. To skip cache use a duration of 0.
*/
fetchAndActivate(cacheExpirationSeconds?: number): Promise<boolean>;
fetchAndActivate(expirationDurationSeconds?: number): Promise<boolean>;
/**
* Retrieve the configuration settings and status for Remote Config.