mutts 1.0.7 → 1.0.8
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/README.md +61 -23
- package/dist/async/browser.d.ts +2 -0
- package/dist/async/browser.d.ts.map +1 -0
- package/dist/async/index.d.ts +18 -0
- package/dist/async/index.d.ts.map +1 -0
- package/dist/async/node.d.ts +2 -0
- package/dist/async/node.d.ts.map +1 -0
- package/dist/{chunks/index-BFYK02LG.js → browser.cjs} +169 -60
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.ts +1654 -1
- package/dist/browser.esm.js +260 -25
- package/dist/browser.esm.js.map +1 -1
- package/dist/chunks/async-browser-CA0jPWIi.cjs +304 -0
- package/dist/chunks/async-browser-CA0jPWIi.cjs.map +1 -0
- package/dist/chunks/async-core-UqHzvJ-S.cjs +25 -0
- package/dist/chunks/async-core-UqHzvJ-S.cjs.map +1 -0
- package/dist/chunks/async-node-BYHuGTni.cjs +103 -0
- package/dist/chunks/async-node-BYHuGTni.cjs.map +1 -0
- package/dist/chunks/{index-CNR6QRUl.esm.js → index-DhaOVusv.esm.js} +173 -53
- package/dist/chunks/index-DhaOVusv.esm.js.map +1 -0
- package/dist/decorator.d.ts +106 -0
- package/dist/decorator.d.ts.map +1 -0
- package/dist/destroyable.d.ts +87 -0
- package/dist/destroyable.d.ts.map +1 -0
- package/dist/devtools/devtool/devtools.d.ts +1 -0
- package/dist/devtools/devtool/devtools.d.ts.map +1 -0
- package/dist/devtools/devtool/panel.d.ts +2 -0
- package/dist/devtools/devtool/panel.d.ts.map +1 -0
- package/dist/entry-browser.d.ts +3 -0
- package/dist/entry-browser.d.ts.map +1 -0
- package/dist/entry-node.d.ts +3 -0
- package/dist/entry-node.d.ts.map +1 -0
- package/dist/eventful.d.ts +18 -0
- package/dist/eventful.d.ts.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/indexable.d.ts +243 -0
- package/dist/indexable.d.ts.map +1 -0
- package/dist/introspection.d.ts +27 -0
- package/dist/introspection.d.ts.map +1 -0
- package/dist/iterableWeak.d.ts +53 -0
- package/dist/iterableWeak.d.ts.map +1 -0
- package/dist/mixins.d.ts +25 -0
- package/dist/mixins.d.ts.map +1 -0
- package/dist/mutts.umd.js +1 -1
- package/dist/mutts.umd.js.map +1 -1
- package/dist/mutts.umd.min.js +1 -1
- package/dist/mutts.umd.min.js.map +1 -1
- package/dist/node.cjs +105 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.ts +1 -2
- package/dist/node.esm.js +91 -32
- package/dist/node.esm.js.map +1 -1
- package/dist/promiseChain.d.ts +20 -0
- package/dist/promiseChain.d.ts.map +1 -0
- package/dist/reactive/array.d.ts +49 -0
- package/dist/reactive/array.d.ts.map +1 -0
- package/dist/reactive/buffer.d.ts +44 -0
- package/dist/reactive/buffer.d.ts.map +1 -0
- package/dist/reactive/change.d.ts +29 -0
- package/dist/reactive/change.d.ts.map +1 -0
- package/dist/reactive/debug.d.ts +111 -0
- package/dist/reactive/debug.d.ts.map +1 -0
- package/dist/reactive/deep-touch.d.ts +28 -0
- package/dist/reactive/deep-touch.d.ts.map +1 -0
- package/dist/reactive/deep-watch-state.d.ts +25 -0
- package/dist/reactive/deep-watch-state.d.ts.map +1 -0
- package/dist/reactive/deep-watch.d.ts +19 -0
- package/dist/reactive/deep-watch.d.ts.map +1 -0
- package/dist/reactive/effect-context.d.ts +7 -0
- package/dist/reactive/effect-context.d.ts.map +1 -0
- package/dist/reactive/effects.d.ts +151 -0
- package/dist/reactive/effects.d.ts.map +1 -0
- package/dist/reactive/index.d.ts +20 -0
- package/dist/reactive/index.d.ts.map +1 -0
- package/dist/reactive/interface.d.ts +64 -0
- package/dist/reactive/interface.d.ts.map +1 -0
- package/dist/reactive/map.d.ts +30 -0
- package/dist/reactive/map.d.ts.map +1 -0
- package/dist/reactive/memoize.d.ts +5 -0
- package/dist/reactive/memoize.d.ts.map +1 -0
- package/dist/reactive/non-reactive-state.d.ts +9 -0
- package/dist/reactive/non-reactive-state.d.ts.map +1 -0
- package/dist/reactive/non-reactive.d.ts +11 -0
- package/dist/reactive/non-reactive.d.ts.map +1 -0
- package/dist/reactive/project.d.ts +41 -0
- package/dist/reactive/project.d.ts.map +1 -0
- package/dist/reactive/proxy-state.d.ts +8 -0
- package/dist/reactive/proxy-state.d.ts.map +1 -0
- package/dist/reactive/proxy.d.ts +23 -0
- package/dist/reactive/proxy.d.ts.map +1 -0
- package/dist/reactive/record.d.ts +116 -0
- package/dist/reactive/record.d.ts.map +1 -0
- package/dist/reactive/register.d.ts +64 -0
- package/dist/reactive/register.d.ts.map +1 -0
- package/dist/reactive/registry.d.ts +20 -0
- package/dist/reactive/registry.d.ts.map +1 -0
- package/dist/reactive/set.d.ts +28 -0
- package/dist/reactive/set.d.ts.map +1 -0
- package/dist/reactive/tracking.d.ts +7 -0
- package/dist/reactive/tracking.d.ts.map +1 -0
- package/dist/reactive/types.d.ts +376 -0
- package/dist/reactive/types.d.ts.map +1 -0
- package/dist/std-decorators.d.ts +50 -0
- package/dist/std-decorators.d.ts.map +1 -0
- package/dist/utils.d.ts +49 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/zone.d.ts +40 -0
- package/dist/zone.d.ts.map +1 -0
- package/docs/std-decorators.md +69 -1
- package/docs/zone.md +7 -0
- package/package.json +39 -27
- package/src/async/browser.ts +266 -34
- package/src/async/index.ts +17 -2
- package/src/async/node.ts +89 -31
- package/src/entry-browser.ts +5 -0
- package/src/entry-node.ts +5 -0
- package/src/index.d.ts +12 -9
- package/src/index.ts +1 -0
- package/src/reactive/array.ts +139 -52
- package/src/reactive/effect-context.ts +3 -3
- package/src/reactive/index.ts +2 -1
- package/src/reactive/map.ts +1 -1
- package/src/reactive/set.ts +1 -1
- package/src/utils.ts +1 -1
- package/src/zone.ts +19 -8
- package/dist/browser.js +0 -161
- package/dist/browser.js.map +0 -1
- package/dist/chunks/index-BFYK02LG.js.map +0 -1
- package/dist/chunks/index-CNR6QRUl.esm.js.map +0 -1
- package/dist/node.js +0 -136
- package/dist/node.js.map +0 -1
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
const asyncHooks = {
|
|
2
2
|
addHook(_hook) {
|
|
3
3
|
throw 'One must import the library from the server or the client side';
|
|
4
|
+
},
|
|
5
|
+
/**
|
|
6
|
+
* [Hack] Sanitize a promise (or value) to prevent context leaks.
|
|
7
|
+
* Default: Identity function.
|
|
8
|
+
* Browser: Uses Macrotask wrapping to break microtask chains.
|
|
9
|
+
*/
|
|
10
|
+
sanitizePromise(p) {
|
|
11
|
+
return p;
|
|
4
12
|
}
|
|
5
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Register a hook that will be called whenever an asynchronous operation is initiated.
|
|
16
|
+
* The hook should return a restorer function which will be called just before the async callback runs.
|
|
17
|
+
* That restorer should in turn return an undoer function which will be called just after the async callback finishes.
|
|
18
|
+
*/
|
|
19
|
+
const asyncHook = (hook) => asyncHooks.addHook(hook);
|
|
6
20
|
|
|
7
21
|
/**
|
|
8
22
|
* Combines multiple arrays into an array of tuples, stopping at the shortest array length
|
|
@@ -264,7 +278,7 @@ function contentRef(container) {
|
|
|
264
278
|
})));
|
|
265
279
|
return contentRefs.get(container);
|
|
266
280
|
}
|
|
267
|
-
function tag(
|
|
281
|
+
function tag(name, obj) {
|
|
268
282
|
Object.defineProperties(obj, {
|
|
269
283
|
[Symbol.toStringTag]: {
|
|
270
284
|
value: name,
|
|
@@ -2057,6 +2071,9 @@ function addToMutationHistory(source, target, obj, prop, evolution) {
|
|
|
2057
2071
|
}
|
|
2058
2072
|
|
|
2059
2073
|
var _ZoneAggregator_zones;
|
|
2074
|
+
function isu(z) {
|
|
2075
|
+
return z;
|
|
2076
|
+
}
|
|
2060
2077
|
class AZone {
|
|
2061
2078
|
enter(value) {
|
|
2062
2079
|
const prev = this.active;
|
|
@@ -2068,12 +2085,16 @@ class AZone {
|
|
|
2068
2085
|
}
|
|
2069
2086
|
with(value, fn) {
|
|
2070
2087
|
const entered = this.enter(value);
|
|
2088
|
+
let res;
|
|
2071
2089
|
try {
|
|
2072
|
-
|
|
2090
|
+
res = fn();
|
|
2073
2091
|
}
|
|
2074
2092
|
finally {
|
|
2075
2093
|
this.leave(entered);
|
|
2076
2094
|
}
|
|
2095
|
+
// [HACK]: Sanitization
|
|
2096
|
+
// See BROWSER_ASYNC_POLYFILL.md
|
|
2097
|
+
return asyncHooks.sanitizePromise(res);
|
|
2077
2098
|
}
|
|
2078
2099
|
root(fn) {
|
|
2079
2100
|
let prev = this.enter();
|
|
@@ -2116,12 +2137,12 @@ class ZoneHistory extends AZone {
|
|
|
2116
2137
|
throw new Error('ZoneHistory: re-entering historical zone');
|
|
2117
2138
|
if (value !== undefined)
|
|
2118
2139
|
self.history.add(value);
|
|
2119
|
-
return { added: value, entered: controlled.enter(value) };
|
|
2140
|
+
return { added: value, entered: isu(controlled).enter(value) };
|
|
2120
2141
|
},
|
|
2121
2142
|
leave(entered) {
|
|
2122
2143
|
if (entered.added !== undefined)
|
|
2123
2144
|
self.history.delete(entered.added);
|
|
2124
|
-
return controlled.leave(entered.entered);
|
|
2145
|
+
return isu(controlled).leave(entered.entered);
|
|
2125
2146
|
}
|
|
2126
2147
|
}));
|
|
2127
2148
|
}
|
|
@@ -2155,13 +2176,13 @@ class ZoneAggregator extends AZone {
|
|
|
2155
2176
|
const entered = new Map();
|
|
2156
2177
|
for (const z of __classPrivateFieldGet(this, _ZoneAggregator_zones, "f")) {
|
|
2157
2178
|
const v = value?.get(z);
|
|
2158
|
-
entered.set(z, z.enter(v));
|
|
2179
|
+
entered.set(z, isu(z).enter(v));
|
|
2159
2180
|
}
|
|
2160
2181
|
return entered;
|
|
2161
2182
|
}
|
|
2162
2183
|
leave(entered) {
|
|
2163
2184
|
for (const z of __classPrivateFieldGet(this, _ZoneAggregator_zones, "f"))
|
|
2164
|
-
z.leave(entered.get(z));
|
|
2185
|
+
isu(z).leave(entered.get(z));
|
|
2165
2186
|
}
|
|
2166
2187
|
add(z) {
|
|
2167
2188
|
__classPrivateFieldGet(this, _ZoneAggregator_zones, "f").add(z);
|
|
@@ -2174,7 +2195,7 @@ class ZoneAggregator extends AZone {
|
|
|
2174
2195
|
}
|
|
2175
2196
|
}
|
|
2176
2197
|
_ZoneAggregator_zones = new WeakMap();
|
|
2177
|
-
const asyncZone = tag(new ZoneAggregator()
|
|
2198
|
+
const asyncZone = tag('async', new ZoneAggregator());
|
|
2178
2199
|
asyncHooks.addHook(() => {
|
|
2179
2200
|
const zone = asyncZone.active;
|
|
2180
2201
|
return () => {
|
|
@@ -2184,10 +2205,10 @@ asyncHooks.addHook(() => {
|
|
|
2184
2205
|
};
|
|
2185
2206
|
});
|
|
2186
2207
|
|
|
2187
|
-
const effectHistory = tag(new ZoneHistory()
|
|
2188
|
-
tag(effectHistory.present,
|
|
2208
|
+
const effectHistory = tag('effectHistory', new ZoneHistory());
|
|
2209
|
+
tag('effectHistory.present', effectHistory.present);
|
|
2189
2210
|
asyncZone.add(effectHistory);
|
|
2190
|
-
const effectAggregator = tag(new ZoneAggregator(effectHistory.present)
|
|
2211
|
+
const effectAggregator = tag('effectAggregator', new ZoneAggregator(effectHistory.present));
|
|
2191
2212
|
function isRunning(effect) {
|
|
2192
2213
|
const root = getRoot(effect);
|
|
2193
2214
|
return effectHistory.some((e) => getRoot(e) === root);
|
|
@@ -5450,6 +5471,17 @@ function scan(source, callback, initialValue) {
|
|
|
5450
5471
|
indexEffects.clear();
|
|
5451
5472
|
});
|
|
5452
5473
|
}
|
|
5474
|
+
function resolve(cb) {
|
|
5475
|
+
const result = reactive([]);
|
|
5476
|
+
return cleanedBy(result, effect(() => {
|
|
5477
|
+
const source = cb();
|
|
5478
|
+
if (result.length !== source.length)
|
|
5479
|
+
result.length = source.length;
|
|
5480
|
+
for (let i = 0; i < source.length; i++)
|
|
5481
|
+
if (result[i] !== source[i])
|
|
5482
|
+
result[i] = source[i];
|
|
5483
|
+
}));
|
|
5484
|
+
}
|
|
5453
5485
|
|
|
5454
5486
|
function* index(i, { length = true } = {}) {
|
|
5455
5487
|
if (length)
|
|
@@ -5522,6 +5554,8 @@ class ReactiveArray extends Array {
|
|
|
5522
5554
|
at(index) {
|
|
5523
5555
|
const actualIndex = index < 0 ? this.length + index : index;
|
|
5524
5556
|
dependant(this, actualIndex);
|
|
5557
|
+
if (index < 0)
|
|
5558
|
+
dependant(this, 'length');
|
|
5525
5559
|
if (actualIndex < 0 || actualIndex >= this.length)
|
|
5526
5560
|
return undefined;
|
|
5527
5561
|
return reactive(this[actualIndex]);
|
|
@@ -5576,36 +5610,61 @@ class ReactiveArray extends Array {
|
|
|
5576
5610
|
};
|
|
5577
5611
|
}
|
|
5578
5612
|
indexOf(searchElement, fromIndex) {
|
|
5579
|
-
|
|
5613
|
+
const length = this.length;
|
|
5614
|
+
let i = fromIndex === undefined ? 0 : fromIndex;
|
|
5615
|
+
if (i < 0)
|
|
5616
|
+
i = Math.max(length + i, 0);
|
|
5580
5617
|
const unwrappedSearch = unwrap(searchElement);
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5618
|
+
for (; i < length; i++) {
|
|
5619
|
+
dependant(this, i);
|
|
5620
|
+
const item = this[i];
|
|
5621
|
+
if (item === searchElement || item === unwrappedSearch || unwrap(item) === unwrappedSearch) {
|
|
5622
|
+
return i;
|
|
5623
|
+
}
|
|
5624
|
+
}
|
|
5625
|
+
dependant(this, 'length');
|
|
5626
|
+
return -1;
|
|
5587
5627
|
}
|
|
5588
5628
|
lastIndexOf(searchElement, fromIndex) {
|
|
5589
|
-
|
|
5629
|
+
const length = this.length;
|
|
5630
|
+
let i = fromIndex === undefined ? length - 1 : fromIndex;
|
|
5631
|
+
if (i >= length)
|
|
5632
|
+
i = length - 1;
|
|
5633
|
+
if (i < 0)
|
|
5634
|
+
i = Math.max(length + i, -1); // -1 ensures loop condition i >= 0 works correctly
|
|
5590
5635
|
const unwrappedSearch = unwrap(searchElement);
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5636
|
+
for (; i >= 0; i--) {
|
|
5637
|
+
dependant(this, i);
|
|
5638
|
+
const item = this[i];
|
|
5639
|
+
if (item === searchElement || item === unwrappedSearch || unwrap(item) === unwrappedSearch) {
|
|
5640
|
+
return i;
|
|
5641
|
+
}
|
|
5642
|
+
}
|
|
5643
|
+
// If we scanned the whole relevant part and didn't find it, we depend on length
|
|
5644
|
+
// (because adding elements might shift indices or add the element)
|
|
5645
|
+
// Actually for lastIndexOf, if we start from end, length dependency is implicit in the start index calculation?
|
|
5646
|
+
// But if we return -1, it means we didn't find it.
|
|
5647
|
+
// If we push an element, should lastIndexOf update?
|
|
5648
|
+
// Yes, if the new element is the one we are looking for.
|
|
5649
|
+
dependant(this, 'length');
|
|
5650
|
+
return -1;
|
|
5597
5651
|
}
|
|
5598
5652
|
includes(searchElement, fromIndex) {
|
|
5599
|
-
|
|
5600
|
-
const unwrappedSearch = unwrap(searchElement);
|
|
5601
|
-
// Check both wrapped and unwrapped versions since array may contain either
|
|
5602
|
-
return this.includes(unwrappedSearch, fromIndex) || this.includes(searchElement, fromIndex);
|
|
5653
|
+
return this.indexOf(searchElement, fromIndex) !== -1;
|
|
5603
5654
|
}
|
|
5604
5655
|
find(predicateOrElement, thisArg) {
|
|
5605
|
-
dependant(this);
|
|
5606
5656
|
if (typeof predicateOrElement === 'function') {
|
|
5607
5657
|
const predicate = predicateOrElement;
|
|
5608
|
-
|
|
5658
|
+
const length = this.length;
|
|
5659
|
+
for (let i = 0; i < length; i++) {
|
|
5660
|
+
dependant(this, i);
|
|
5661
|
+
const val = reactive(this[i]);
|
|
5662
|
+
if (predicate.call(thisArg, val, i, this)) {
|
|
5663
|
+
return val;
|
|
5664
|
+
}
|
|
5665
|
+
}
|
|
5666
|
+
dependant(this, 'length');
|
|
5667
|
+
return undefined;
|
|
5609
5668
|
}
|
|
5610
5669
|
const fromIndex = typeof thisArg === 'number' ? thisArg : undefined;
|
|
5611
5670
|
const index = this.indexOf(predicateOrElement, fromIndex);
|
|
@@ -5614,10 +5673,18 @@ class ReactiveArray extends Array {
|
|
|
5614
5673
|
return reactive(this[index]);
|
|
5615
5674
|
}
|
|
5616
5675
|
findIndex(predicateOrElement, thisArg) {
|
|
5617
|
-
dependant(this);
|
|
5618
5676
|
if (typeof predicateOrElement === 'function') {
|
|
5619
5677
|
const predicate = predicateOrElement;
|
|
5620
|
-
|
|
5678
|
+
const length = this.length;
|
|
5679
|
+
for (let i = 0; i < length; i++) {
|
|
5680
|
+
dependant(this, i);
|
|
5681
|
+
const val = reactive(this[i]);
|
|
5682
|
+
if (predicate.call(thisArg, val, i, this)) {
|
|
5683
|
+
return i;
|
|
5684
|
+
}
|
|
5685
|
+
}
|
|
5686
|
+
dependant(this, 'length');
|
|
5687
|
+
return -1;
|
|
5621
5688
|
}
|
|
5622
5689
|
const fromIndex = typeof thisArg === 'number' ? thisArg : undefined;
|
|
5623
5690
|
return this.indexOf(predicateOrElement, fromIndex);
|
|
@@ -5676,12 +5743,26 @@ class ReactiveArray extends Array {
|
|
|
5676
5743
|
});
|
|
5677
5744
|
}
|
|
5678
5745
|
every(callbackfn, thisArg) {
|
|
5679
|
-
|
|
5680
|
-
|
|
5746
|
+
const length = this.length;
|
|
5747
|
+
for (let i = 0; i < length; i++) {
|
|
5748
|
+
dependant(this, i);
|
|
5749
|
+
if (!callbackfn.call(thisArg, reactive(this[i]), i, this)) {
|
|
5750
|
+
return false;
|
|
5751
|
+
}
|
|
5752
|
+
}
|
|
5753
|
+
dependant(this, 'length');
|
|
5754
|
+
return true;
|
|
5681
5755
|
}
|
|
5682
5756
|
some(callbackfn, thisArg) {
|
|
5683
|
-
|
|
5684
|
-
|
|
5757
|
+
const length = this.length;
|
|
5758
|
+
for (let i = 0; i < length; i++) {
|
|
5759
|
+
dependant(this, i);
|
|
5760
|
+
if (callbackfn.call(thisArg, reactive(this[i]), i, this)) {
|
|
5761
|
+
return true;
|
|
5762
|
+
}
|
|
5763
|
+
}
|
|
5764
|
+
dependant(this, 'length');
|
|
5765
|
+
return false;
|
|
5685
5766
|
}
|
|
5686
5767
|
// Side-effectful
|
|
5687
5768
|
push(...items) {
|
|
@@ -5723,19 +5804,29 @@ class ReactiveArray extends Array {
|
|
|
5723
5804
|
}
|
|
5724
5805
|
splice(start, deleteCount, ...items) {
|
|
5725
5806
|
const oldLength = this.length;
|
|
5726
|
-
|
|
5727
|
-
|
|
5807
|
+
// Normalize start index
|
|
5808
|
+
let actualStart = start;
|
|
5809
|
+
if (actualStart < 0)
|
|
5810
|
+
actualStart = Math.max(oldLength + actualStart, 0);
|
|
5811
|
+
else
|
|
5812
|
+
actualStart = Math.min(actualStart, oldLength);
|
|
5813
|
+
// Normalize deleteCount
|
|
5814
|
+
let actualDeleteCount = deleteCount;
|
|
5815
|
+
if (actualDeleteCount === undefined) {
|
|
5816
|
+
actualDeleteCount = oldLength - actualStart;
|
|
5817
|
+
}
|
|
5818
|
+
else {
|
|
5819
|
+
actualDeleteCount = Math.max(0, Math.min(actualDeleteCount, oldLength - actualStart));
|
|
5820
|
+
}
|
|
5728
5821
|
try {
|
|
5729
5822
|
if (deleteCount === undefined)
|
|
5730
5823
|
return reactive(this.splice(start));
|
|
5731
5824
|
return reactive(this.splice(start, deleteCount, ...items));
|
|
5732
5825
|
}
|
|
5733
5826
|
finally {
|
|
5734
|
-
touched(this, { type: 'bunch', method: 'splice' },
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
? range(start, start + deleteCount)
|
|
5738
|
-
: range(start, oldLength + Math.max(items.length - deleteCount, 0), {
|
|
5827
|
+
touched(this, { type: 'bunch', method: 'splice' }, actualDeleteCount === items.length
|
|
5828
|
+
? range(actualStart, actualStart + actualDeleteCount - 1)
|
|
5829
|
+
: range(actualStart, oldLength + Math.max(items.length - actualDeleteCount, 0), {
|
|
5739
5830
|
length: true,
|
|
5740
5831
|
}));
|
|
5741
5832
|
}
|
|
@@ -5758,6 +5849,17 @@ class ReactiveArray extends Array {
|
|
|
5758
5849
|
}
|
|
5759
5850
|
}
|
|
5760
5851
|
fill(value, start, end) {
|
|
5852
|
+
const len = this.length;
|
|
5853
|
+
let k = start === undefined ? 0 : start;
|
|
5854
|
+
if (k < 0)
|
|
5855
|
+
k = Math.max(len + k, 0);
|
|
5856
|
+
else
|
|
5857
|
+
k = Math.min(k, len);
|
|
5858
|
+
let final = end === undefined ? len : end;
|
|
5859
|
+
if (final < 0)
|
|
5860
|
+
final = Math.max(len + final, 0);
|
|
5861
|
+
else
|
|
5862
|
+
final = Math.min(final, len);
|
|
5761
5863
|
try {
|
|
5762
5864
|
if (start === undefined)
|
|
5763
5865
|
return this.fill(value);
|
|
@@ -5766,7 +5868,9 @@ class ReactiveArray extends Array {
|
|
|
5766
5868
|
return this.fill(value, start, end);
|
|
5767
5869
|
}
|
|
5768
5870
|
finally {
|
|
5769
|
-
|
|
5871
|
+
if (final > k) {
|
|
5872
|
+
touched(this, { type: 'bunch', method: 'fill' }, range(k, final - 1));
|
|
5873
|
+
}
|
|
5770
5874
|
}
|
|
5771
5875
|
}
|
|
5772
5876
|
copyWithin(target, start, end) {
|
|
@@ -5776,11 +5880,27 @@ class ReactiveArray extends Array {
|
|
|
5776
5880
|
return this.copyWithin(target, start, end);
|
|
5777
5881
|
}
|
|
5778
5882
|
finally {
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5883
|
+
const len = this.length;
|
|
5884
|
+
let to = target;
|
|
5885
|
+
if (to < 0)
|
|
5886
|
+
to = Math.max(len + to, 0);
|
|
5887
|
+
else if (to >= len)
|
|
5888
|
+
to = len;
|
|
5889
|
+
let from = start;
|
|
5890
|
+
if (from < 0)
|
|
5891
|
+
from = Math.max(len + from, 0);
|
|
5892
|
+
else if (from >= len)
|
|
5893
|
+
from = len;
|
|
5894
|
+
let final = end === undefined ? len : end;
|
|
5895
|
+
if (final < 0)
|
|
5896
|
+
final = Math.max(len + final, 0);
|
|
5897
|
+
else if (final >= len)
|
|
5898
|
+
final = len;
|
|
5899
|
+
const count = Math.min(final - from, len - to);
|
|
5900
|
+
if (count > 0) {
|
|
5901
|
+
touched(this, { type: 'bunch', method: 'copyWithin' }, range(to, to + count - 1));
|
|
5902
|
+
}
|
|
5782
5903
|
}
|
|
5783
|
-
// Touch all affected indices with a single allProps call
|
|
5784
5904
|
}
|
|
5785
5905
|
}
|
|
5786
5906
|
|
|
@@ -5876,7 +5996,7 @@ class ReactiveMap extends Map {
|
|
|
5876
5996
|
return this;
|
|
5877
5997
|
},
|
|
5878
5998
|
[Symbol.dispose]() { },
|
|
5879
|
-
};
|
|
5999
|
+
}; // TODO: real iterator? (If easy)
|
|
5880
6000
|
}
|
|
5881
6001
|
// Implement Map methods with reactivity
|
|
5882
6002
|
delete(key) {
|
|
@@ -6021,7 +6141,7 @@ class ReactiveSet extends Set {
|
|
|
6021
6141
|
return this;
|
|
6022
6142
|
},
|
|
6023
6143
|
[Symbol.dispose]() { },
|
|
6024
|
-
};
|
|
6144
|
+
}; //TODO? (something easy)
|
|
6025
6145
|
}
|
|
6026
6146
|
}
|
|
6027
6147
|
|
|
@@ -6238,7 +6358,7 @@ function throttle(delay) {
|
|
|
6238
6358
|
});
|
|
6239
6359
|
}
|
|
6240
6360
|
|
|
6241
|
-
var version$1 = "1.0.
|
|
6361
|
+
var version$1 = "1.0.8";
|
|
6242
6362
|
var pkg = {
|
|
6243
6363
|
version: version$1};
|
|
6244
6364
|
|
|
@@ -6287,5 +6407,5 @@ if (globalScope) {
|
|
|
6287
6407
|
globalScope[GLOBAL_MUTTS_KEY] = currentSourceInfo;
|
|
6288
6408
|
}
|
|
6289
6409
|
|
|
6290
|
-
export {
|
|
6291
|
-
//# sourceMappingURL=index-
|
|
6410
|
+
export { isCached as $, AZone as A, contentRef as B, debounce as C, DecoratorError as D, Eventful as E, FoolProof as F, decorator as G, deepCompare as H, Indexable as I, deepWatch as J, defer as K, deprecated as L, derived as M, describe as N, destructor as O, effect as P, effectAggregator as Q, ReactiveBase as R, enableDevTools as S, forwardArray as T, getActivationLog as U, getActiveEffect as V, getActiveProjection as W, getAt as X, getState as Y, Zone as Z, immutables as _, asyncHooks as a, isConstructor as a0, isDevtoolsEnabled as a1, isNonReactive as a2, isOwnAccessor as a3, isReactive as a4, legacyDecorator as a5, memoize as a6, mixin as a7, modernDecorator as a8, named as a9, zip as aA, organize as aa, organized as ab, profileInfo as ac, project as ad, reactive as ae, options as af, register as ag, registerEffectForDebug as ah, registerNativeReactivity as ai, registerObjectForDebug as aj, renamed as ak, resolve as al, root as am, scan as an, setAt as ao, setEffectName as ap, setObjectName as aq, tag as ar, throttle as as, touched as at, touched1 as au, trackEffect as av, unreactive as aw, untracked as ax, unwrap as ay, watch as az, ArrayReadForward as b, Destroyable as c, DestructionError as d, IterableWeakMap as e, IterableWeakSet as f, ReactiveError as g, ReactiveErrorCode as h, Register as i, ZoneAggregator as j, ZoneHistory as k, addBatchCleanup as l, allocated as m, allocatedValues as n, arrayEquals as o, asyncHook as p, asyncZone as q, atomic as r, biDi as s, buildReactivityGraph as t, cache as u, cached as v, callOnGC as w, chainPromise as x, cleanedBy as y, cleanup as z };
|
|
6411
|
+
//# sourceMappingURL=index-DhaOVusv.esm.js.map
|