The properties that were set while initialization. These properties will nevet change.
A callback that is launched when properties are changed
A callback that is launched when properties are changed
Name of the responsive properties.
const static = {
myProp: true,
};
const responsive = [
{
breakpoint: 'm',
settings: {
myProp: false
}
}
];
const props = new MutableProps(static, responsive);
Private
_activeActive breakpoints used to define if properties have changed
Private
_appVevet Application.
Private
_initThe properties that were set while initialization. These properties will nevet change.
Private
_nameName of the responsive properties.
Private
_onA callback that is launched when properties are changed
Private
_propsCurrent properties.
These properties may change both on changeProps
and resize.
Private
_refReference properties.
These properties may change only through changeProps
.
Private
_responsiveA set of responsive rules
Private
Optional
_viewportViewport callback
Get current properties
Private
_responseAdd responsive rules
A class for creating mutable properties that can change on window resize.
There are two ways to change properties:
To set a resize-listener on window (or use Viewport). When the window is resized, change the properties with the help of
changeProps
The second way is to use the MutableProps and add responsive properties with help of
addResponsiveProps
.Example