Skip to content

Instantly share code, notes, and snippets.

@grantsheppard
Created April 6, 2017 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grantsheppard/66effdf3a4981c684308377b0e381041 to your computer and use it in GitHub Desktop.
Save grantsheppard/66effdf3a4981c684308377b0e381041 to your computer and use it in GitHub Desktop.
// 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