Skip to main content

watch

Function watch 

Source
pub fn watch(window: &Window, told: impl FnMut(Prefers) + 'static)
Expand description

Follow the system preference for as long as the page is open: told is called whenever the browser changes its mind, which is what keeps [Mode::System] actually following rather than sampling once at startup.

The listener outlives this call and is never taken down — it is the page’s, and the page ends with the tab.