@shopify/app-bridge-host
Version:
App Bridge Host contains middleware and components that are meant to be consumed by the app's host. The middleware and `Frame` component are responsible for facilitating messages posted between the client and host, and used to act on actions sent from the
42 lines (41 loc) • 1.56 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var _1 = require("./");
var Provider = /** @class */ (function (_super) {
__extends(Provider, _super);
function Provider(props) {
var _this = _super.call(this, props) || this;
_this.middleware = props.middleware;
return _this;
}
Provider.prototype.getChildContext = function () {
return {
appBridgeMiddleware: this.middleware,
};
};
Provider.prototype.render = function () {
return react_1.default.Children.only(this.props.children);
};
Provider.childContextTypes = {
appBridgeMiddleware: _1.appBridgeMiddlewareProptype,
};
return Provider;
}(react_1.default.Component));
exports.Provider = Provider;