diff --git a/packages/config/lib/index.d.ts b/packages/config/lib/index.d.ts index 302eac3c..770dd828 100644 --- a/packages/config/lib/index.d.ts +++ b/packages/config/lib/index.d.ts @@ -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; + fetch(expirationDurationSeconds?: number): Promise; /** * 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; + fetchAndActivate(expirationDurationSeconds?: number): Promise; /** * Retrieve the configuration settings and status for Remote Config. diff --git a/packages/config/lib/index.js b/packages/config/lib/index.js index 33479ced..b816420c 100644 --- a/packages/config/lib/index.js +++ b/packages/config/lib/index.js @@ -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} */ - 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, ); } diff --git a/packages/config/lib/index.js.flow b/packages/config/lib/index.js.flow index 37fa1be0..d362884d 100644 --- a/packages/config/lib/index.js.flow +++ b/packages/config/lib/index.js.flow @@ -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; + fetch(expirationDurationSeconds?: number): Promise; /** * 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; + fetchAndActivate(expirationDurationSeconds?: number): Promise; /** * Retrieve the configuration settings and status for Remote Config.