mediaQuerySignal

G
W

Takes a media query, and updates its value whenever the state of that query being matched changes. It does this by wrapping a call to window.matchMedia and listening to its change event.

The value overload accepts a manualDestroy option. When it is true the signal does not have to be created in an injector context, but it is up to the developer to destroy it.

Observing when an element is visible on an ancestor