feat(useIdle): implement Stoppable interface#5068
Merged
antfu merged 11 commits intovueuse:mainfrom Oct 22, 2025
Merged
Conversation
Member
|
Could you briefly describe the use case for this change? |
Contributor
Author
|
For example, useIdle is used globally in the system to monitor user operations and display the leave status. If you want to pause these monitoring in some routes (such as the page for watching videos), it is more convenient to add these two methods const { idle,stop,reuse } = useIdle(5000) |
9romise
requested changes
Sep 27, 2025
Stoppable interface
9romise
previously approved these changes
Sep 27, 2025
Member
9romise
left a comment
There was a problem hiding this comment.
Would you be willing to add some test cases for your changes?
@vueuse/components
@vueuse/core
@vueuse/electron
@vueuse/firebase
@vueuse/integrations
@vueuse/math
@vueuse/metadata
@vueuse/nuxt
@vueuse/router
@vueuse/rxjs
@vueuse/shared
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5068 +/- ##
==========================================
+ Coverage 67.24% 67.58% +0.34%
==========================================
Files 367 367
Lines 14695 14717 +22
Branches 2439 2453 +14
==========================================
+ Hits 9881 9946 +65
+ Misses 4803 4760 -43
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
OrbisK
requested changes
Sep 27, 2025
OrbisK
requested changes
Sep 29, 2025
9romise
requested changes
Sep 29, 2025
9romise
approved these changes
Sep 29, 2025
OrbisK
approved these changes
Sep 30, 2025
antfu
approved these changes
Oct 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Added stop and reuse methods to the useIdle composable function:
These methods provide better lifecycle management for the useIdle composable, following VueUse's standard patterns for composable functions that need cleanup and re-initialization capabilities.