mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-12 22:39:15 +08:00
[config] rename cacheExpirationSeconds arg to expirationDurationSeconds
[skip ci]
This commit is contained in:
8
packages/config/lib/index.d.ts
vendored
8
packages/config/lib/index.d.ts
vendored
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user