The Viewport Data Edit

Namespace: core/viewport.

Selectors Selectors

# isViewportMatch

Returns true if the viewport matches the given query, or false otherwise.

Usage

isViewportMatch( state, '< huge' );
isViewPortMatch( state, 'medium' );

Parameters

  • state Object: Viewport state object.
  • query string: Query string. Includes operator and breakpoint name, space separated. Operator defaults to >=.

Returns

  • boolean: Whether viewport matches query.

Top ↑

Actions Actions

# setIsMatching

Returns an action object used in signalling that viewport queries have been
updated. Values are specified as an object of breakpoint query keys where
value represents whether query matches.

Parameters

  • values Object: Breakpoint query matches.

Returns

  • Object: Action object.