Created
April 6, 2017 04:28
-
-
Save grantsheppard/3aed6392d0c6fb59c9265c98852eca43 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.children(isToggledOn) | |
} | |
// and to use it | |
<Toggle toggleName="featureAorB"> | |
{ isToggledOn => isToggledOn ? <FeatureA /> : <FeatureB /> } | |
</Toggle> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment