@@ -55,7 +55,7 @@ Add a feature flag called *Beta* to the App Configuration store and leave **Labe
55
55
56
56
async function run() {
57
57
// Connect to Azure App Configuration using endpoint and token credential
58
- const settings = await load(endpoint, credential, {
58
+ const appConfig = await load(endpoint, credential, {
59
59
featureFlagOptions: {
60
60
enabled: true,
61
61
// Note: selectors must be explicitly provided for feature flags.
@@ -69,13 +69,11 @@ Add a feature flag called *Beta* to the App Configuration store and leave **Labe
69
69
}
70
70
});
71
71
72
- // Create a feature flag provider which uses a map as feature flag source
73
- const ffProvider = new ConfigurationMapFeatureFlagProvider(settings);
74
72
// Create a feature manager which will evaluate the feature flag
75
- const fm = new FeatureManager(ffProvider );
73
+ const fm = new FeatureManager(new ConfigurationMapFeatureFlagProvider(appConfig) );
76
74
77
75
while (true) {
78
- await settings .refresh(); // Refresh to get the latest feature flag settings
76
+ await appConfig .refresh(); // Refresh to get the latest feature flag settings
79
77
const isEnabled = await fm.isEnabled("Beta"); // Evaluate the feature flag
80
78
console.log(`Beta is enabled: ${isEnabled}`);
81
79
await sleepInMs(5000);
@@ -94,7 +92,7 @@ Add a feature flag called *Beta* to the App Configuration store and leave **Labe
94
92
95
93
async function run() {
96
94
// Connect to Azure App Configuration using connection string
97
- const settings = await load(connectionString, {
95
+ const appConfig = await load(connectionString, {
98
96
featureFlagOptions: {
99
97
enabled: true,
100
98
// Note: selectors must be explicitly provided for feature flags.
@@ -108,13 +106,11 @@ Add a feature flag called *Beta* to the App Configuration store and leave **Labe
108
106
}
109
107
});
110
108
111
- // Create a feature flag provider which uses a map as feature flag source
112
- const ffProvider = new ConfigurationMapFeatureFlagProvider(settings);
113
109
// Create a feature manager which will evaluate the feature flag
114
- const fm = new FeatureManager(ffProvider );
110
+ const fm = new FeatureManager(new ConfigurationMapFeatureFlagProvider(appConfig) );
115
111
116
112
while (true) {
117
- await settings .refresh(); // Refresh to get the latest feature flag settings
113
+ await appConfig .refresh(); // Refresh to get the latest feature flag settings
118
114
const isEnabled = await fm.isEnabled("Beta"); // Evaluate the feature flag
119
115
console.log(`Beta is enabled: ${isEnabled}`);
120
116
await sleepInMs(5000);
0 commit comments