feat(watch): watchImmediate
and watchDeep
support overloads
#2998
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before submitting the PR, please make sure you do the following
fixes #123
).Description
Currently, the type for watchImmediate and watchDeep do not allow passing an array of multiple data sources. This PR addresses this issue by using overloads."
馃 Generated by Copilot at c6bd046
This pull request improves the functionality and organization of the
watchDeep
andwatchImmediate
functions, which allow reactive watchers for deep or immediate changes. It introduces a new typeMultiWatchSources
to handle multiple sources, and moves the functions to separate files underpackages/shared
.馃 Generated by Copilot at c6bd046
watchDeep
andwatchImmediate
functions to support watching multiple sources with deep or immediate options (link, link, link)MapSources
,MapOldSources
, andImmediate
types to infer source and callback types and omit redundant options (link, link)any
casts, and relaxed source constraints to handle any arguments (link, link)watchDeep
andwatchImmediate
functions from their original files topackages/shared/utils/types.ts
for better organization (link, link)