react-awesome-feature-toggles
Version:
Simple feature toggles for react and react router
18 lines (13 loc) • 324 B
JavaScript
let featureConfig = {}
export const isToggleEnabled = (toggleName) => {
if (featureConfig[toggleName]) {
return true
}
return false
}
export const setFeatureConfig = (config = {}) => {
if (typeof config !== 'object') {
throw new Error('Feature config has to be an object')
}
featureConfig = config
}