Skip to content

Commit 4a28be9

Browse files
authored
feat(watchPausable): deprecate watchPausable (#5040)
1 parent d317610 commit 4a28be9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/shared/watchPausable/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ alias: pausableWatch
77

88
Pausable watch
99

10+
::: info
11+
This function will be removed in future version.
12+
:::
13+
1014
::: tip
1115

1216
[Pausable Watcher](https://vuejs.org/api/reactivity-core.html#watch) has been added to Vue [since 3.5](https://github.com/vuejs/core/pull/9651), use `const { stop, pause, resume } = watch(watchSource, callback)` instead.

packages/shared/watchPausable/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export interface WatchPausableReturn extends Pausable {
1010

1111
export type WatchPausableOptions<Immediate> = WatchWithFilterOptions<Immediate> & PausableFilterOptions
1212

13+
/**
14+
* @deprecated This function will be removed in future version.
15+
*/
1316
export function watchPausable<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn
1417
export function watchPausable<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn
1518
export function watchPausable<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn

0 commit comments

Comments
 (0)