Skip to content

Instantly share code, notes, and snippets.

@TheTempas
TheTempas / featureFlag.ts
Last active June 25, 2024 19:54
Feature Flag
const newFeature = await this.featureFlags.newFeature(); // retrieve value of Feature Flag
if (newFeature) {
await this.newFeatureLogic(data); // execute logic for new feature
} else {
await this.statusQuoLogic(data); // execute logic that is the status quo
}
@TheTempas
TheTempas / featureFlagUsingKey.ts
Last active December 21, 2022 21:23
Feature Flag Using Key
const createWithNewProductUI = await this.featureFlags.newProductUI({ key: brandId });
if (createWithNewProductUI) {
await this.createProduct(product);
}
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
</head>