UNPKG

react-native-ibm-mobilefirst-liveupdate

Version:

React Native SDK for IBM Mobile liveupdate. Works with IBM Mobile First.

42 lines (34 loc) 1.21 kB
/* Licensed Materials - Property of IBM * 5725-I43 (C) Copyright IBM Corp. 2020. All Rights Reserved. * US Government Users Restricted Rights - Use, duplication or * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ /* Author - Manjunath Kallannavar | manjunathkavar@in.ibm.com */ import { _mandatoryParam, _checkParamType } from './Utils'; class Configuration { constructor(res) { this.results = res; } /* * Check if a feature is enabled * @param featureId - the feature id to be checked * @return true if feature is enabled or undefined for non existing feature. */ isFeatureEnabled(featureId = _mandatoryParam('featureId')) { _checkParamType(featureId, 'string'); return this.results["features"][featureId]; } /** * Get value of a property * @param propertyId - the property id * @return the value for the given propertyId, or undefined in case the property doesn't exist */ getProperty(propertyId = _mandatoryParam('propertyId')) { _checkParamType(propertyId, 'string'); return this.results["properties"][propertyId]; } } export default Configuration;