Skip to content

feat(effectScope): add onDispose method #10826

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

Open
wants to merge 9 commits into
base: minor
Choose a base branch
from

Conversation

Alfred-Skyblue
Copy link
Member

When the effectScope is not active, we can only listen to its dispose in the following way:

const scope = effectScope();

scope.run(() => {});

scope.cleanups.push(() => {
  /* code */
});

Although this method solves the current problem, it is rather cumbersome. In this PR, I have added an onDispose method, allowing us to listen to the dispose of effectScope in the following manner:

const scope = effectScope();

scope.run(() => {});

scope.onDispose(() => {
  /* code */
});

Copy link

github-actions bot commented Apr 28, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 99 kB (+31 B) 37.5 kB (+12 B) 33.8 kB (+33 B)
vue.global.prod.js 157 kB (+31 B) 57.3 kB (+12 B) 50.9 kB (-60 B)

Usages

Name Size Gzip Brotli
createApp 54.2 kB (+35 B) 21 kB (+14 B) 19.2 kB (+18 B)
createSSRApp 58.2 kB (+35 B) 22.6 kB (+16 B) 20.6 kB (+17 B)
defineCustomElement 58.8 kB (+35 B) 22.5 kB (+14 B) 20.5 kB (+64 B)
overall 67.8 kB (+35 B) 26 kB (+14 B) 23.7 kB (+60 B)

Copy link

netlify bot commented Aug 12, 2024

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit 7089247
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/66b953a609978a000805e158

@edison1105 edison1105 deleted the branch vuejs:minor October 21, 2024 07:37
@edison1105 edison1105 closed this Oct 21, 2024
@edison1105 edison1105 reopened this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants