@flipfeatureflag/core 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
- package/src/client.ts +3 -2
package/dist/index.js
CHANGED
|
@@ -231,7 +231,9 @@ var FlipFlagClient = class {
|
|
|
231
231
|
if (cached) {
|
|
232
232
|
return this.recordEvaluation(flagKey, cached);
|
|
233
233
|
}
|
|
234
|
-
|
|
234
|
+
if (!this.options.disableRefresh) {
|
|
235
|
+
void this.refresh([flagKey]);
|
|
236
|
+
}
|
|
235
237
|
return this.recordEvaluation(flagKey, {
|
|
236
238
|
value: defaultValue,
|
|
237
239
|
variationKey: "default",
|
|
@@ -286,7 +288,6 @@ var FlipFlagClient = class {
|
|
|
286
288
|
return this.refreshInFlight;
|
|
287
289
|
}
|
|
288
290
|
applyEvaluate(response) {
|
|
289
|
-
this.evaluations.clear();
|
|
290
291
|
for (const [key, evaluation] of Object.entries(response.flags)) {
|
|
291
292
|
this.evaluations.set(key, evaluation);
|
|
292
293
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -205,7 +205,9 @@ var FlipFlagClient = class {
|
|
|
205
205
|
if (cached) {
|
|
206
206
|
return this.recordEvaluation(flagKey, cached);
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
if (!this.options.disableRefresh) {
|
|
209
|
+
void this.refresh([flagKey]);
|
|
210
|
+
}
|
|
209
211
|
return this.recordEvaluation(flagKey, {
|
|
210
212
|
value: defaultValue,
|
|
211
213
|
variationKey: "default",
|
|
@@ -260,7 +262,6 @@ var FlipFlagClient = class {
|
|
|
260
262
|
return this.refreshInFlight;
|
|
261
263
|
}
|
|
262
264
|
applyEvaluate(response) {
|
|
263
|
-
this.evaluations.clear();
|
|
264
265
|
for (const [key, evaluation] of Object.entries(response.flags)) {
|
|
265
266
|
this.evaluations.set(key, evaluation);
|
|
266
267
|
}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -138,7 +138,9 @@ export class FlipFlagClient {
|
|
|
138
138
|
return this.recordEvaluation(flagKey, cached);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
if (!this.options.disableRefresh) {
|
|
142
|
+
void this.refresh([flagKey]);
|
|
143
|
+
}
|
|
142
144
|
return this.recordEvaluation(flagKey, {
|
|
143
145
|
value: defaultValue,
|
|
144
146
|
variationKey: "default",
|
|
@@ -203,7 +205,6 @@ export class FlipFlagClient {
|
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
private applyEvaluate(response: SdkEvaluateResponse) {
|
|
206
|
-
this.evaluations.clear();
|
|
207
208
|
for (const [key, evaluation] of Object.entries(response.flags)) {
|
|
208
209
|
this.evaluations.set(key, evaluation);
|
|
209
210
|
}
|