-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(runtime-core, reactivity): baseWatch
and onWatcherCleanup
#9927
base: minor
Are you sure you want to change the base?
feat(runtime-core, reactivity): baseWatch
and onWatcherCleanup
#9927
Conversation
…t/onEffectCleanup-and-baseWatch
…ectCleanup-and-baseWatch
f3e5303
to
7c5f05a
Compare
Regarding the API design of If you have any better design suggestions, please put them forward here. I am very happy to listen your suggestions. |
53263a5
to
e550ce9
Compare
e550ce9
to
770c21d
Compare
Size ReportBundles
Usages
|
I created another separate PR #10173 for |
onEffectCleanup
and baseWatch
baseWatch
2ef9594
to
589cd11
Compare
baseWatch
baseWatch
and onWatcherCleanup
Due to the obvious difference between |
34e750f
to
a5769e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kevin suggested that I move the types and enums related to scheduler in baseWatch
into a separate file in reactivity, hence this Commit.
This PR achieves two objectives:
It refactors the
apiWatch
implementation, incorporating most of its functionality into thebaseWatch
in reactivity.It incorporates the
onWatcherCleanup
, previously used in vue/core-vapor repository, directly into the reactivity package of vue/core repository.baseWatch
The rationale behind refactoring
apiWatch
is that Vapor requires Watch APIs. However runtime-vapor should not import runtime-core directly. If we don't share reusable Watch API logic between runtime-core and runtime-vapor, it will result in significant code duplication. Furthermore, we plan to extract other codes that can be shared between these two runtimes into separate packages.onWatcherCleanup
The
onWatcherCleanup
function has already been implemented in Vapor. Here are corresponding Issue and PR links:Issue / PR
Additionally, provide support for
watch