UNPKG

@qonversion/react-native-sdk

Version:

Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation. Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and co

24 lines (17 loc) 721 B
import RemoteConfig from './RemoteConfig'; class RemoteConfigList { remoteConfigs: Array<RemoteConfig>; constructor(remoteConfigs: Array<RemoteConfig>) { this.remoteConfigs = remoteConfigs; } remoteConfigForContextKey(contextKey: string): RemoteConfig | undefined { return this.findRemoteConfigForContextKey(contextKey); } remoteConfigForEmptyContextKey(): RemoteConfig | undefined { return this.findRemoteConfigForContextKey(null); } private findRemoteConfigForContextKey(contextKey: string | null): RemoteConfig | undefined { return this.remoteConfigs.find(config => config.source.contextKey == contextKey); } } export default RemoteConfigList;