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/index.d.ts CHANGED
@@ -44,9 +44,9 @@ declare enum ScheduleStatus {
44
44
 
45
45
  declare class NoopEffect {
46
46
  callback: () => OnClean | any;
47
- constructor(callback: () => OnClean | any);
47
+ constructor(callback: () => OnClean | any, _type?: any);
48
48
  }
49
- declare const noopEffect: (callback: () => OnClean | any) => Scope;
49
+ declare const noopEffect: (callback: Function, deps?: any[], _opt?: any) => Scope;
50
50
  declare class Scope {
51
51
  callback: () => OnClean | any;
52
52
  emitHead: Link;
@@ -204,6 +204,7 @@ type MatchValue<V1, T2, P2> = (DeepValue<T2, P2> extends V1 ? P2 : never);
204
204
  declare class Store {
205
205
  static [IsStore]: boolean;
206
206
  static [StoreIgnoreKeys]: Key[];
207
+ static [Keys.ProxyFreeObject]: boolean;
207
208
  static Current: Store;
208
209
  constructor();
209
210
  parent: () => Store | null;
package/dist/index.umd.js CHANGED
@@ -735,14 +735,25 @@
735
735
  }
736
736
  }
737
737
  class NoopEffect {
738
- constructor(callback) {
738
+ constructor(callback, _type) {
739
739
  this.callback = callback;
740
740
  const scope = new Scope(callback);
741
741
  scope.get();
742
742
  return scope;
743
743
  }
744
744
  }
745
- const noopEffect = callback => {
745
+ const noopEffect = (callback, deps, _opt) => {
746
+ if (deps && deps.length > 0) {
747
+ const scope = new Scope(() => {
748
+ const vs = deps.map(d => ({
749
+ old: undefined,
750
+ val: typeof d === 'function' ? d() : d.get()
751
+ }));
752
+ callback(...vs);
753
+ });
754
+ scope.get();
755
+ return scope;
756
+ }
746
757
  const scope = new Scope(callback);
747
758
  scope.get();
748
759
  return scope;
@@ -1430,6 +1441,7 @@
1430
1441
  class Store {
1431
1442
  static [IsStore] = true;
1432
1443
  static [StoreIgnoreKeys] = ['ui', 'raw'];
1444
+ static [Keys.ProxyFreeObject] = true;
1433
1445
  static Current = null;
1434
1446
  constructor() {
1435
1447
  const proxy = deepSignal(this, getPulling(), true);