menu
Menu
Mobify DevCenter
search_icon_focus

Component

progressive-web-sdk/dist/utils/component

getBoundedValue(value, minimumValue, maximumValue)

The function returns a value with an upper bound and a lower bound.

Import
import { getBoundedValue } from 'progressive-web-sdk/dist/utils/component

Returns:

Number

ParameterTypeDescription
valuenumberthe value to set for bounded vlue
minimumValuenumberthe minium value
maximumValuenumberthe maxium value

Example

import {getBoundedValue} from 'progressive-web-sdk/dist/utils/component'
getBoundedValue(2, 5, 10) // 5

getDisplayName(WrappedComponent)

Display the name of the component

Import
import { getDisplayName } from 'progressive-web-sdk/dist/utils/component

Returns:

String

ParameterTypeDescription
WrappedComponentfunctionthe name of the component

Example

import {getDisplayName} from 'progressive-web-sdk/dist/utils/component'
class AnotherMockComponent extends React.Component {
render() {
return (<div>More mock html</div>)
}
}
getDisplayName(AnotherMockComponent) // "AnotherMockComponent"