GoScrobble/web/node_modules/react-cookie/es6/CookiesProvider.js

35 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-04-25 02:47:15 +00:00
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 __());
};
})();
import * as React from 'react';
import Cookies from 'universal-cookie';
import { Provider } from './CookiesContext';
var CookiesProvider = /** @class */ (function (_super) {
__extends(CookiesProvider, _super);
function CookiesProvider(props) {
var _this = _super.call(this, props) || this;
if (props.cookies) {
_this.cookies = props.cookies;
}
else {
_this.cookies = new Cookies();
}
return _this;
}
CookiesProvider.prototype.render = function () {
return React.createElement(Provider, { value: this.cookies }, this.props.children);
};
return CookiesProvider;
}(React.Component));
export default CookiesProvider;