// This is quite simple reducer, containing only an array of features. // You can attach this data to a `currentUser` or similar reducer. // `BOOTSTAP` is global action, which contains the initial data for a page // Features access usually don't change during user usage of a page const BOOTSTAP = 'features/receive'; export default featuresReducer(state, { type, payload }) { if (type === BOOTSTAP) { return payload.features || []; } return state || []; } export function isFeatureEnabled(features, featureName) { return features.indexOf(featureName) !== -1; }