@flagship.io/react-sdk 2.2.0-beta.2 → 2.2.0-beta.6
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/es/FlagshipContext.js +15 -3
- package/dist/es/FlagshipHooks.js +2 -24
- package/dist/es/index.js +1 -1
- package/dist/esm/FlagshipContext.js +15 -3
- package/dist/esm/FlagshipHooks.js +3 -60
- package/dist/esm/index.js +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/FlagshipContext.d.ts +5 -6
- package/dist/types/FlagshipHooks.d.ts +8 -6
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -36,7 +36,12 @@ export const FlagshipProvider = ({
|
|
|
36
36
|
initialBucketing,
|
|
37
37
|
initialCampaigns,
|
|
38
38
|
initialModifications,
|
|
39
|
-
synchronizeOnBucketingUpdated
|
|
39
|
+
synchronizeOnBucketingUpdated,
|
|
40
|
+
activateDeduplicationTime,
|
|
41
|
+
hitDeduplicationTime,
|
|
42
|
+
visitorCacheImplementation,
|
|
43
|
+
hitCacheImplementation,
|
|
44
|
+
disableCache
|
|
40
45
|
}) => {
|
|
41
46
|
let modifications = new Map();
|
|
42
47
|
|
|
@@ -205,7 +210,12 @@ export const FlagshipProvider = ({
|
|
|
205
210
|
enableClientCache,
|
|
206
211
|
decisionApiUrl,
|
|
207
212
|
onBucketingUpdated: onBucketingLastModified,
|
|
208
|
-
initialBucketing
|
|
213
|
+
initialBucketing,
|
|
214
|
+
activateDeduplicationTime,
|
|
215
|
+
hitDeduplicationTime,
|
|
216
|
+
visitorCacheImplementation,
|
|
217
|
+
hitCacheImplementation,
|
|
218
|
+
disableCache
|
|
209
219
|
});
|
|
210
220
|
};
|
|
211
221
|
|
|
@@ -227,5 +237,7 @@ export const FlagshipProvider = ({
|
|
|
227
237
|
}, handleDisplay());
|
|
228
238
|
};
|
|
229
239
|
FlagshipProvider.defaultProps = {
|
|
230
|
-
nodeEnv: 'production'
|
|
240
|
+
nodeEnv: 'production',
|
|
241
|
+
activateDeduplicationTime: 10,
|
|
242
|
+
hitDeduplicationTime: 10
|
|
231
243
|
};
|
package/dist/es/FlagshipHooks.js
CHANGED
|
@@ -296,19 +296,7 @@ export const useFlagship = () => {
|
|
|
296
296
|
await fsSynchronizeModifications(functionName, visitor, config);
|
|
297
297
|
};
|
|
298
298
|
|
|
299
|
-
const
|
|
300
|
-
const functionName = 'getModificationsSync';
|
|
301
|
-
return fsModificationsSync({
|
|
302
|
-
functionName,
|
|
303
|
-
state,
|
|
304
|
-
visitor,
|
|
305
|
-
config,
|
|
306
|
-
params,
|
|
307
|
-
activateAll
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
const getModifications = async (params, activateAll) => {
|
|
299
|
+
const getModifications = (params, activateAll) => {
|
|
312
300
|
const functionName = 'getModifications';
|
|
313
301
|
return fsModificationsSync({
|
|
314
302
|
functionName,
|
|
@@ -320,15 +308,7 @@ export const useFlagship = () => {
|
|
|
320
308
|
});
|
|
321
309
|
};
|
|
322
310
|
|
|
323
|
-
const
|
|
324
|
-
return fsModificationInfoSync({
|
|
325
|
-
key,
|
|
326
|
-
state,
|
|
327
|
-
visitor
|
|
328
|
-
});
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
const getModificationInfo = async key => {
|
|
311
|
+
const getModificationInfo = key => {
|
|
332
312
|
return fsModificationInfoSync({
|
|
333
313
|
key,
|
|
334
314
|
state,
|
|
@@ -344,11 +324,9 @@ export const useFlagship = () => {
|
|
|
344
324
|
status: state.status,
|
|
345
325
|
activateModification,
|
|
346
326
|
synchronizeModifications,
|
|
347
|
-
getModificationsSync,
|
|
348
327
|
getModifications,
|
|
349
328
|
modifications: modifications || [],
|
|
350
329
|
getModificationInfo,
|
|
351
|
-
getModificationInfoSync,
|
|
352
330
|
hit: {
|
|
353
331
|
send: fsSendHit,
|
|
354
332
|
sendMultiple: fsSendHits
|
package/dist/es/index.js
CHANGED
|
@@ -53,7 +53,12 @@ export var FlagshipProvider = function FlagshipProvider(_ref) {
|
|
|
53
53
|
initialBucketing = _ref.initialBucketing,
|
|
54
54
|
initialCampaigns = _ref.initialCampaigns,
|
|
55
55
|
initialModifications = _ref.initialModifications,
|
|
56
|
-
synchronizeOnBucketingUpdated = _ref.synchronizeOnBucketingUpdated
|
|
56
|
+
synchronizeOnBucketingUpdated = _ref.synchronizeOnBucketingUpdated,
|
|
57
|
+
activateDeduplicationTime = _ref.activateDeduplicationTime,
|
|
58
|
+
hitDeduplicationTime = _ref.hitDeduplicationTime,
|
|
59
|
+
visitorCacheImplementation = _ref.visitorCacheImplementation,
|
|
60
|
+
hitCacheImplementation = _ref.hitCacheImplementation,
|
|
61
|
+
disableCache = _ref.disableCache;
|
|
57
62
|
var modifications = new Map();
|
|
58
63
|
|
|
59
64
|
if (initialModifications) {
|
|
@@ -227,7 +232,12 @@ export var FlagshipProvider = function FlagshipProvider(_ref) {
|
|
|
227
232
|
enableClientCache: enableClientCache,
|
|
228
233
|
decisionApiUrl: decisionApiUrl,
|
|
229
234
|
onBucketingUpdated: onBucketingLastModified,
|
|
230
|
-
initialBucketing: initialBucketing
|
|
235
|
+
initialBucketing: initialBucketing,
|
|
236
|
+
activateDeduplicationTime: activateDeduplicationTime,
|
|
237
|
+
hitDeduplicationTime: hitDeduplicationTime,
|
|
238
|
+
visitorCacheImplementation: visitorCacheImplementation,
|
|
239
|
+
hitCacheImplementation: hitCacheImplementation,
|
|
240
|
+
disableCache: disableCache
|
|
231
241
|
});
|
|
232
242
|
};
|
|
233
243
|
|
|
@@ -249,5 +259,7 @@ export var FlagshipProvider = function FlagshipProvider(_ref) {
|
|
|
249
259
|
}, handleDisplay());
|
|
250
260
|
};
|
|
251
261
|
FlagshipProvider.defaultProps = {
|
|
252
|
-
nodeEnv: 'production'
|
|
262
|
+
nodeEnv: 'production',
|
|
263
|
+
activateDeduplicationTime: 10,
|
|
264
|
+
hitDeduplicationTime: 10
|
|
253
265
|
};
|
|
@@ -436,8 +436,8 @@ export var useFlagship = function useFlagship() {
|
|
|
436
436
|
};
|
|
437
437
|
}();
|
|
438
438
|
|
|
439
|
-
var
|
|
440
|
-
var functionName = '
|
|
439
|
+
var getModifications = function getModifications(params, activateAll) {
|
|
440
|
+
var functionName = 'getModifications';
|
|
441
441
|
return fsModificationsSync({
|
|
442
442
|
functionName: functionName,
|
|
443
443
|
state: state,
|
|
@@ -448,37 +448,7 @@ export var useFlagship = function useFlagship() {
|
|
|
448
448
|
});
|
|
449
449
|
};
|
|
450
450
|
|
|
451
|
-
var
|
|
452
|
-
var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(params, activateAll) {
|
|
453
|
-
var functionName;
|
|
454
|
-
return regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
455
|
-
while (1) {
|
|
456
|
-
switch (_context7.prev = _context7.next) {
|
|
457
|
-
case 0:
|
|
458
|
-
functionName = 'getModifications';
|
|
459
|
-
return _context7.abrupt("return", fsModificationsSync({
|
|
460
|
-
functionName: functionName,
|
|
461
|
-
state: state,
|
|
462
|
-
visitor: visitor,
|
|
463
|
-
config: config,
|
|
464
|
-
params: params,
|
|
465
|
-
activateAll: activateAll
|
|
466
|
-
}));
|
|
467
|
-
|
|
468
|
-
case 2:
|
|
469
|
-
case "end":
|
|
470
|
-
return _context7.stop();
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}, _callee7);
|
|
474
|
-
}));
|
|
475
|
-
|
|
476
|
-
return function getModifications(_x10, _x11) {
|
|
477
|
-
return _ref9.apply(this, arguments);
|
|
478
|
-
};
|
|
479
|
-
}();
|
|
480
|
-
|
|
481
|
-
var getModificationInfoSync = function getModificationInfoSync(key) {
|
|
451
|
+
var getModificationInfo = function getModificationInfo(key) {
|
|
482
452
|
return fsModificationInfoSync({
|
|
483
453
|
key: key,
|
|
484
454
|
state: state,
|
|
@@ -486,31 +456,6 @@ export var useFlagship = function useFlagship() {
|
|
|
486
456
|
});
|
|
487
457
|
};
|
|
488
458
|
|
|
489
|
-
var getModificationInfo = /*#__PURE__*/function () {
|
|
490
|
-
var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(key) {
|
|
491
|
-
return regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
492
|
-
while (1) {
|
|
493
|
-
switch (_context8.prev = _context8.next) {
|
|
494
|
-
case 0:
|
|
495
|
-
return _context8.abrupt("return", fsModificationInfoSync({
|
|
496
|
-
key: key,
|
|
497
|
-
state: state,
|
|
498
|
-
visitor: visitor
|
|
499
|
-
}));
|
|
500
|
-
|
|
501
|
-
case 1:
|
|
502
|
-
case "end":
|
|
503
|
-
return _context8.stop();
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}, _callee8);
|
|
507
|
-
}));
|
|
508
|
-
|
|
509
|
-
return function getModificationInfo(_x12) {
|
|
510
|
-
return _ref10.apply(this, arguments);
|
|
511
|
-
};
|
|
512
|
-
}();
|
|
513
|
-
|
|
514
459
|
return {
|
|
515
460
|
updateContext: fsUpdateContext,
|
|
516
461
|
clearContext: fsClearContext,
|
|
@@ -519,11 +464,9 @@ export var useFlagship = function useFlagship() {
|
|
|
519
464
|
status: state.status,
|
|
520
465
|
activateModification: activateModification,
|
|
521
466
|
synchronizeModifications: synchronizeModifications,
|
|
522
|
-
getModificationsSync: getModificationsSync,
|
|
523
467
|
getModifications: getModifications,
|
|
524
468
|
modifications: modifications || [],
|
|
525
469
|
getModificationInfo: getModificationInfo,
|
|
526
|
-
getModificationInfoSync: getModificationInfoSync,
|
|
527
470
|
hit: {
|
|
528
471
|
send: fsSendHit,
|
|
529
472
|
sendMultiple: fsSendHits
|
package/dist/esm/index.js
CHANGED