Component
progressive-web-sdk/dist/utils/component
getBoundedValue(value, minimumValue, maximumValue)
The function returns a value with an upper bound and a lower bound.
Importimport { getBoundedValue } from 'progressive-web-sdk/dist/utils/component
Returns:
Number
Parameter | Type | Description |
---|---|---|
value | number | the value to set for bounded vlue |
minimumValue | number | the minium value |
maximumValue | number | the 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
Importimport { getDisplayName } from 'progressive-web-sdk/dist/utils/component
Returns:
String
Parameter | Type | Description |
---|---|---|
WrappedComponent | function | the 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"