Skip to content

Added a hook for usePageVisibility#1

Open
technikhil314 wants to merge 1 commit into
gragland:masterfrom
technikhil314:master
Open

Added a hook for usePageVisibility#1
technikhil314 wants to merge 1 commit into
gragland:masterfrom
technikhil314:master

Conversation

@technikhil314

Copy link
Copy Markdown

Added a hook for usePageVisibility

This hook can be used to stop visual computation such as pausing a video or carousel when user is no more active on your react app. and again resuming the video or carousel when user focuses back on your app.

It uses Page Visibility API which works in tab switching in same browser and also uses window.onblur/window.onfocus events when user switches away from browser window.

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.

1 participant