Created
April 6, 2017 04:32
-
-
Save grantsheppard/66effdf3a4981c684308377b0e381041 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a simple feature toggle FaCC | |
const Toggle = () => { | |
const isToggledOn = checkToggle(this.props.toggleName) | |
return this.props.render(isToggledOn) | |
} | |
// and to use it | |
<Toggle | |
toggleName="featureAorB" | |
render={isToggledOn => isToggledOn ? <FeatureA /> : <FeatureB />} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment