kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
59 lines (58 loc) • 6.98 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = _interopRequireDefault(require("react"));
var _console = _interopRequireDefault(require("global/console"));
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
var ErrorBoundary = exports["default"] = /*#__PURE__*/function (_React$Component) {
function ErrorBoundary() {
var _this;
(0, _classCallCheck2["default"])(this, ErrorBoundary);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _callSuper(this, ErrorBoundary, [].concat(args));
(0, _defineProperty2["default"])(_this, "state", {
hasError: false
});
return _this;
}
(0, _inherits2["default"])(ErrorBoundary, _React$Component);
return (0, _createClass2["default"])(ErrorBoundary, [{
key: "componentDidCatch",
value: function componentDidCatch(error, errorInfo) {
// You can also log the error to an error reporting service
_console["default"].error(error, errorInfo);
}
}, {
key: "render",
value: function render() {
if (this.state.hasError) {
// You can render any custom fallback UI
return /*#__PURE__*/_react["default"].createElement("h1", null, "Something went wrong.");
}
return this.props.children;
}
}], [{
key: "getDerivedStateFromError",
value: function getDerivedStateFromError(error) {
// Update state so the next render will show the fallback UI.
return {
hasError: true,
error: error
};
}
}]);
}(_react["default"].Component);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9jb25zb2xlIiwiX2NhbGxTdXBlciIsInQiLCJvIiwiZSIsIl9nZXRQcm90b3R5cGVPZjIiLCJfcG9zc2libGVDb25zdHJ1Y3RvclJldHVybjIiLCJfaXNOYXRpdmVSZWZsZWN0Q29uc3RydWN0IiwiUmVmbGVjdCIsImNvbnN0cnVjdCIsImNvbnN0cnVjdG9yIiwiYXBwbHkiLCJCb29sZWFuIiwicHJvdG90eXBlIiwidmFsdWVPZiIsImNhbGwiLCJFcnJvckJvdW5kYXJ5IiwiZXhwb3J0cyIsIl9SZWFjdCRDb21wb25lbnQiLCJfdGhpcyIsIl9jbGFzc0NhbGxDaGVjazIiLCJfbGVuIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwiYXJncyIsIkFycmF5IiwiX2tleSIsImNvbmNhdCIsIl9kZWZpbmVQcm9wZXJ0eTIiLCJoYXNFcnJvciIsIl9pbmhlcml0czIiLCJfY3JlYXRlQ2xhc3MyIiwia2V5IiwidmFsdWUiLCJjb21wb25lbnREaWRDYXRjaCIsImVycm9yIiwiZXJyb3JJbmZvIiwiY29uc29sZSIsInJlbmRlciIsInN0YXRlIiwiY3JlYXRlRWxlbWVudCIsInByb3BzIiwiY2hpbGRyZW4iLCJnZXREZXJpdmVkU3RhdGVGcm9tRXJyb3IiLCJSZWFjdCIsIkNvbXBvbmVudCJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb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