Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Browser/Events.elm
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ onResize func =


{-| Subscribe to any visibility changes, like if the user switches to a
different tab or window. When the user looks away, you may want to:
different tab or minimizes the window. When the user looks away, you may want to:

- Pause a timer.
- Pause an animation.
Expand All @@ -218,6 +218,11 @@ different tab or window. When the user looks away, you may want to:
- Stop polling a server for new information.
- Stop waiting for an [`onKeyUp`](#onKeyUp) event.

**Note:** Switching to a different window on a desktop browser will likely not fire the event,
since browsers don’t know if the window is actually obscured or not. See the docs on the
[Page Visibility API](https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API).


-}
onVisibilityChange : (Visibility -> msg) -> Sub msg
onVisibilityChange func =
Expand Down