MCPcopy Create free account
hub / github.com/microsoft/SandDance / WithResponsiveMode

Function WithResponsiveMode

docs/app/js/sanddance-app.js:31104–31118  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

31102 var resultClass = (_a = /** @class */ function(_super) {
31103 (0, _tslib.__extends)(WithResponsiveMode, _super);
31104 function WithResponsiveMode(props) {
31105 var _this = _super.call(this, props) || this;
31106 _this._onResize = function() {
31107 var responsiveMode = getResponsiveMode(_this.context.window);
31108 if (responsiveMode !== _this.state.responsiveMode) _this.setState({
31109 responsiveMode: responsiveMode
31110 });
31111 };
31112 _this._events = new (0, _utilities.EventGroup)(_this);
31113 _this._updateComposedComponentRef = _this._updateComposedComponentRef.bind(_this);
31114 _this.state = {
31115 responsiveMode: getInitialResponsiveMode()
31116 };
31117 return _this;
31118 }
31119 WithResponsiveMode.prototype.componentDidMount = function() {
31120 this._events.on(this.context.window, "resize", this._onResize);
31121 this._onResize();

Callers

nothing calls this directly

Calls 2

getResponsiveModeFunction · 0.85
getInitialResponsiveModeFunction · 0.85

Tested by

no test coverage detected