Primitives / foldkit-primitives/media
MediaQuery
const · packages/primitives/src/media/mediaquery.ts:43
| Args | { query: string } |
|---|---|
| Model | { matches: boolean } |
| Messages | Changed { matches: boolean } |
Its full type
const MediaQuery: Bundle.Bundle<
'MediaQuery',
{ readonly query: string },
{ readonly matches: boolean },
{ readonly _tag: 'Changed'; readonly matches: boolean },
never,
never,
never,
void,
{},
{}
>A media query as a bundle: matches in the Model, kept current by a
matchMedia change stream. State stays in the parent Model, so it replays
and time-travels like any other state; the browser only reports facts.
In the guides
- Which form a primitive takesPrimitives / foldkit-primitives
- Sixty seconds: follow the color schemePrimitives / foldkit-primitives
- Find one by the jobPrimitives / foldkit-primitives
- The mapPrimitives / foldkit-primitives
- foldkit-primitives/mediaPrimitives / Media