@mpxjs/core 2.8.3 → 2.8.4

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/@types/index.d.ts CHANGED
@@ -428,7 +428,7 @@ type WatchSource<T> =
428
428
  | (() => T) // getter
429
429
  | ComputedRef<T>
430
430
 
431
- type MultiWatchSources = (WatchSource<unknown> | object)[]
431
+ // type MultiWatchSources = (WatchSource<unknown> | object)[]
432
432
 
433
433
  interface WatchEffectOptions {
434
434
  flush?: 'pre' | 'post' | 'sync' // default: 'pre'
@@ -528,14 +528,11 @@ export function watchPostEffect (
528
528
  options?: WatchEffectOptions
529
529
  ): void
530
530
 
531
- export function watch<T extends MultiWatchSources> (
532
- sources: [...T],
533
- callback: WatchCallback<T>,
534
- options?: WatchOptions
535
- ): () => void
536
- export function watch<T extends Readonly<MultiWatchSources>> (
531
+ export function watch<T extends Readonly<(WatchSource<unknown> | object)[]>> (
537
532
  sources: T,
538
- callback: WatchCallback<T>,
533
+ callback: WatchCallback<{
534
+ [K in keyof T]: T[K] extends WatchSource<infer V> ? V : T[K] extends object ? T[K] : never
535
+ }>,
539
536
  options?: WatchOptions
540
537
  ): () => void
541
538
  export function watch<T> ( // for single watcher
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/core",
3
- "version": "2.8.3",
3
+ "version": "2.8.4",
4
4
  "description": "mpx runtime core",
5
5
  "keywords": [
6
6
  "miniprogram",
@@ -47,5 +47,5 @@
47
47
  "url": "https://github.com/didi/mpx/issues"
48
48
  },
49
49
  "sideEffects": false,
50
- "gitHead": "23705e69a1fa13d696316a3593e4f29692fde376"
50
+ "gitHead": "a86c688ee61f5c313feb1b1c28d03ab26cd42d37"
51
51
  }