akeyless-client-commons 1.0.173 → 1.0.174
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/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +13 -1
- package/dist/hooks/index.mjs +13 -1
- package/package.json +1 -1
package/dist/hooks/index.d.mts
CHANGED
|
@@ -25,7 +25,7 @@ interface OnSnapshotConfig extends OnSnapshotParsers {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
declare const useDocumentTitle: (title: string) => any;
|
|
28
|
-
declare const useSnapshotBulk: (configs: OnSnapshotConfig[], label?: string) => void;
|
|
28
|
+
declare const useSnapshotBulk: (configs: OnSnapshotConfig[], label?: string, cleanupForConfigChange?: boolean) => void;
|
|
29
29
|
declare const useSetUserCountry: (setUserCountry: Dispatch<SetStateAction<CountryOptions>>, changLang: (lang: string) => void) => any;
|
|
30
30
|
|
|
31
31
|
declare function useSafeEffect(callback: () => void, dependencies: any[], error_message?: string): void;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ interface OnSnapshotConfig extends OnSnapshotParsers {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
declare const useDocumentTitle: (title: string) => any;
|
|
28
|
-
declare const useSnapshotBulk: (configs: OnSnapshotConfig[], label?: string) => void;
|
|
28
|
+
declare const useSnapshotBulk: (configs: OnSnapshotConfig[], label?: string, cleanupForConfigChange?: boolean) => void;
|
|
29
29
|
declare const useSetUserCountry: (setUserCountry: Dispatch<SetStateAction<CountryOptions>>, changLang: (lang: string) => void) => any;
|
|
30
30
|
|
|
31
31
|
declare function useSafeEffect(callback: () => void, dependencies: any[], error_message?: string): void;
|
package/dist/hooks/index.js
CHANGED
|
@@ -528,6 +528,7 @@ var useDocumentTitle = function(title) {
|
|
|
528
528
|
return null;
|
|
529
529
|
};
|
|
530
530
|
var useSnapshotBulk = function(configs, label) {
|
|
531
|
+
var cleanupForConfigChange = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
531
532
|
var snapshotsFirstTime = (0, import_react3.useRef)([]);
|
|
532
533
|
var unsubscribeFunctions = (0, import_react3.useRef)([]);
|
|
533
534
|
useDeepCompareEffect(function() {
|
|
@@ -544,9 +545,20 @@ var useSnapshotBulk = function(configs, label) {
|
|
|
544
545
|
})).then(function() {
|
|
545
546
|
console.log("==> ".concat(label || "Custom snapshots", " ended. It took ").concat((performance.now() - start).toFixed(2), " ms"));
|
|
546
547
|
});
|
|
548
|
+
if (cleanupForConfigChange) {
|
|
549
|
+
return function() {
|
|
550
|
+
unsubscribeFunctions.current.forEach(function(unsubscribe) {
|
|
551
|
+
if (unsubscribe) {
|
|
552
|
+
unsubscribe();
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
console.log("==> ".concat(label || "Custom snapshots", " unsubscribed"));
|
|
556
|
+
};
|
|
557
|
+
}
|
|
547
558
|
}, [
|
|
548
559
|
configs,
|
|
549
|
-
label
|
|
560
|
+
label,
|
|
561
|
+
cleanupForConfigChange
|
|
550
562
|
]);
|
|
551
563
|
(0, import_react3.useEffect)(function() {
|
|
552
564
|
return function() {
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -440,6 +440,7 @@ var useDocumentTitle = function(title) {
|
|
|
440
440
|
return null;
|
|
441
441
|
};
|
|
442
442
|
var useSnapshotBulk = function(configs, label) {
|
|
443
|
+
var cleanupForConfigChange = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
443
444
|
var snapshotsFirstTime = useRef2([]);
|
|
444
445
|
var unsubscribeFunctions = useRef2([]);
|
|
445
446
|
useDeepCompareEffect(function() {
|
|
@@ -456,9 +457,20 @@ var useSnapshotBulk = function(configs, label) {
|
|
|
456
457
|
})).then(function() {
|
|
457
458
|
console.log("==> ".concat(label || "Custom snapshots", " ended. It took ").concat((performance.now() - start).toFixed(2), " ms"));
|
|
458
459
|
});
|
|
460
|
+
if (cleanupForConfigChange) {
|
|
461
|
+
return function() {
|
|
462
|
+
unsubscribeFunctions.current.forEach(function(unsubscribe) {
|
|
463
|
+
if (unsubscribe) {
|
|
464
|
+
unsubscribe();
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
console.log("==> ".concat(label || "Custom snapshots", " unsubscribed"));
|
|
468
|
+
};
|
|
469
|
+
}
|
|
459
470
|
}, [
|
|
460
471
|
configs,
|
|
461
|
-
label
|
|
472
|
+
label,
|
|
473
|
+
cleanupForConfigChange
|
|
462
474
|
]);
|
|
463
475
|
useEffect2(function() {
|
|
464
476
|
return function() {
|