ag-common 0.0.63 → 0.0.64
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MutexData = void 0;
|
|
4
4
|
/* eslint-disable class-methods-use-this */
|
|
5
|
+
const _1 = require(".");
|
|
5
6
|
const log_1 = require("../../common/helpers/log");
|
|
6
7
|
const useLocalStorage_1 = require("./useLocalStorage");
|
|
7
8
|
class MutexData {
|
|
@@ -42,5 +43,11 @@ class MutexData {
|
|
|
42
43
|
this.pingSubscribers(key);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
delete(key) {
|
|
47
|
+
(0, _1.clearLocalStorageItem)(`mutex-${key}`);
|
|
48
|
+
if (Object.keys(this.subscriptions).length > 0) {
|
|
49
|
+
this.pingSubscribers(key);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
45
52
|
}
|
|
46
53
|
exports.MutexData = MutexData;
|
|
@@ -2,6 +2,7 @@ import { AxiosResponse } from 'axios';
|
|
|
2
2
|
import { OverrideAuth } from './callOpenApi';
|
|
3
3
|
import { CacheItems } from './routes';
|
|
4
4
|
import { AxiosWrapper, User } from './jwt';
|
|
5
|
+
export declare const deleteMutexData: (key: string) => void;
|
|
5
6
|
export declare const setMutexData: ({ key, data, ttlSeconds, }: {
|
|
6
7
|
key: string;
|
|
7
8
|
data: any;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.setOpenApiCache = exports.useOpenApiStore = exports.getMutexData = exports.setMutexData = void 0;
|
|
12
|
+
exports.setOpenApiCache = exports.useOpenApiStore = exports.getMutexData = exports.setMutexData = exports.deleteMutexData = void 0;
|
|
13
13
|
const react_1 = require("react");
|
|
14
14
|
const mutex_1 = require("./mutex");
|
|
15
15
|
const mutexData_1 = require("./mutexData");
|
|
@@ -22,6 +22,8 @@ const mutex = new mutex_1.Mutex({
|
|
|
22
22
|
});
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
24
|
const mutexData = new mutexData_1.MutexData();
|
|
25
|
+
const deleteMutexData = (key) => mutexData.delete(key);
|
|
26
|
+
exports.deleteMutexData = deleteMutexData;
|
|
25
27
|
const setMutexData = ({ key, data, ttlSeconds = 3600, }) => {
|
|
26
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
29
|
const wrap = {
|