j-templates 7.0.45 → 7.0.47
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.
|
@@ -174,10 +174,10 @@ function DirtyScope(scope) {
|
|
|
174
174
|
else
|
|
175
175
|
emitter_1.Emitter.Emit(scope.emitter, scope);
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
let scopeQueue = [];
|
|
178
178
|
function ProcessScopeQueue() {
|
|
179
|
-
const scopes =
|
|
180
|
-
scopeQueue
|
|
179
|
+
const scopes = scopeQueue;
|
|
180
|
+
scopeQueue = [];
|
|
181
181
|
for (let x = 0; x < scopes.length; x++)
|
|
182
182
|
DirtyScope(scopes[x]);
|
|
183
183
|
}
|
|
@@ -185,9 +185,9 @@ function OnSet(scope) {
|
|
|
185
185
|
if (scope.destroyed)
|
|
186
186
|
return true;
|
|
187
187
|
if (scope.async || scope.calcFunctions.length > 0) {
|
|
188
|
-
if (scopeQueue.
|
|
188
|
+
if (scopeQueue.length === 0)
|
|
189
189
|
queueMicrotask(ProcessScopeQueue);
|
|
190
|
-
scopeQueue.
|
|
190
|
+
scopeQueue.push(scope);
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
193
|
DirtyScope(scope);
|
package/Utils/distinctArray.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ export type DistinctArray<T> = {
|
|
|
4
4
|
array: T[];
|
|
5
5
|
};
|
|
6
6
|
export declare namespace DistinctArray {
|
|
7
|
-
function Create<T>(id
|
|
7
|
+
function Create<T>(id?: (value: T) => unknown): DistinctArray<T>;
|
|
8
8
|
function Push<T>(distinctArr: DistinctArray<T>, value: T): void;
|
|
9
9
|
function Get<T>({ array }: DistinctArray<T>): T[];
|
|
10
|
+
function Size<T>(distinct: DistinctArray<T>): number;
|
|
11
|
+
function Clear<T>(distinct: DistinctArray<T>): void;
|
|
10
12
|
}
|
package/Utils/distinctArray.js
CHANGED
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DistinctArray = void 0;
|
|
4
4
|
var DistinctArray;
|
|
5
5
|
(function (DistinctArray) {
|
|
6
|
-
function Create(id) {
|
|
6
|
+
function Create(id = (val) => val) {
|
|
7
7
|
return {
|
|
8
8
|
id,
|
|
9
9
|
distinct: null,
|
|
10
|
-
array: []
|
|
10
|
+
array: [],
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
DistinctArray.Create = Create;
|
|
@@ -18,7 +18,9 @@ var DistinctArray;
|
|
|
18
18
|
break;
|
|
19
19
|
case 1: {
|
|
20
20
|
if (distinctArr.distinct === null) {
|
|
21
|
-
distinctArr.distinct = new Set([
|
|
21
|
+
distinctArr.distinct = new Set([
|
|
22
|
+
distinctArr.id(distinctArr.array[0]),
|
|
23
|
+
]);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
default: {
|
|
@@ -35,4 +37,13 @@ var DistinctArray;
|
|
|
35
37
|
return array;
|
|
36
38
|
}
|
|
37
39
|
DistinctArray.Get = Get;
|
|
40
|
+
function Size(distinct) {
|
|
41
|
+
return distinct.distinct.size;
|
|
42
|
+
}
|
|
43
|
+
DistinctArray.Size = Size;
|
|
44
|
+
function Clear(distinct) {
|
|
45
|
+
distinct.array = [];
|
|
46
|
+
distinct.distinct?.clear();
|
|
47
|
+
}
|
|
48
|
+
DistinctArray.Clear = Clear;
|
|
38
49
|
})(DistinctArray || (exports.DistinctArray = DistinctArray = {}));
|