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
# Notify Github that a deployment has started - we use that for convenience | |
DEPLOY_ID=$(curl -s -X POST \ | |
-H "Authorization: token $GITHUB_API_TOKEN" \ | |
-H "Accept: application/vnd.github.flash-preview+json" \ | |
-d "{\"ref\": \"$CIRCLE_SHA1\", \"auto_merge\": false, \"environment\": \"$CIRCLE_BRANCH\", \"required_contexts\": [], \"transient_environment\": true}" \ | |
"https://api.github.com/repos/<account>/<reponame>/deployments" | \ | |
python -c "import sys, json; print json.load(sys.stdin)['id']") | |
# Deploy to zeit.now |
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
export const withFeatureFlag = (featureFlag: string, defaultValue: boolean) => <P extends object>( | |
Component: React.ComponentType<P>, | |
) => { | |
interface WithFeatureFlagProps { | |
[featureFlag: string]: boolean | undefined; | |
} | |
const WithFeatureFlag: React.FC<P & WithFeatureFlagProps> = props => { | |
const [flag, setFlag] = useState<boolean>(defaultValue); | |
// Initial query for feature flag |