Skip to content
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(watchTriggerable): extending watch with a manual trigger #1736

Merged
merged 8 commits into from Jul 6, 2022

Conversation

LittleSound
Copy link
Contributor

@LittleSound LittleSound commented Jul 2, 2022

Description

When you want to manually call a watch / watchEffect that uses the onCleanup parameter; simply taking the WatchCallback out and calling it doesn't make it easy to implement the onCleanup parameter.

The watchTriggerable function is a secondary wrapper around watchIgnorable, which returns a trigger function that immediately executes a WatchCallback and solves the problem of implementing onCleanup.

Additional context

issue: #1712


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@LittleSound LittleSound changed the title feat(watchTriggerable): [WIP] extending watch with a manual trigger feat(watchTriggerable): extending watch with a manual trigger Jul 2, 2022
@LittleSound LittleSound marked this pull request as ready for review July 2, 2022 16:33
@antfu antfu merged commit cf663ff into vueuse:main Jul 6, 2022
@LittleSound LittleSound deleted the dev/feat-watchTriggerable branch July 6, 2022 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants