aoye 0.0.58 → 0.0.60
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/aoye.cjs.js +14 -2
- package/dist/aoye.cjs.js.map +1 -1
- package/dist/aoye.esm.js +14 -2
- package/dist/aoye.esm.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.umd.js +14 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/aoye.cjs.js
CHANGED
|
@@ -733,14 +733,25 @@ class Scope {
|
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
735
|
class NoopEffect {
|
|
736
|
-
constructor(callback) {
|
|
736
|
+
constructor(callback, _type) {
|
|
737
737
|
this.callback = callback;
|
|
738
738
|
const scope = new Scope(callback);
|
|
739
739
|
scope.get();
|
|
740
740
|
return scope;
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
const noopEffect = callback => {
|
|
743
|
+
const noopEffect = (callback, deps, _opt) => {
|
|
744
|
+
if (deps && deps.length > 0) {
|
|
745
|
+
const scope = new Scope(() => {
|
|
746
|
+
const vs = deps.map(d => ({
|
|
747
|
+
old: undefined,
|
|
748
|
+
val: typeof d === 'function' ? d() : d.get()
|
|
749
|
+
}));
|
|
750
|
+
callback(...vs);
|
|
751
|
+
});
|
|
752
|
+
scope.get();
|
|
753
|
+
return scope;
|
|
754
|
+
}
|
|
744
755
|
const scope = new Scope(callback);
|
|
745
756
|
scope.get();
|
|
746
757
|
return scope;
|
|
@@ -1428,6 +1439,7 @@ const isParentKey = (parentStore, expr) => expr in parentStore[Keys.Raw];
|
|
|
1428
1439
|
class Store {
|
|
1429
1440
|
static [IsStore] = true;
|
|
1430
1441
|
static [StoreIgnoreKeys] = ['ui', 'raw'];
|
|
1442
|
+
static [Keys.ProxyFreeObject] = true;
|
|
1431
1443
|
static Current = null;
|
|
1432
1444
|
constructor() {
|
|
1433
1445
|
const proxy = deepSignal(this, getPulling(), true);
|