ts
import { matchMedia } from '@trail-run/core/reactive/match-media';Function: matchMedia()
ts
function matchMedia(query): PropertyDecorator;Defined in: src/reactive/match-media.ts:47
Decorator which marks a field as being populated via window.matchMedia.
The field's value will be a boolean indicating whether the media query matches.
The field will automatically reactively update when the media query's match status changes.
Example:
ts
class DeviceService {
@matchMedia('(prefers-color-scheme: dark)')
prefersDarkMode: boolean = false;
}
## Parameters
### query
`string`
## Returns
`PropertyDecorator`