Skip to content

Instantly share code, notes, and snippets.

@manjula-dube
Created March 31, 2019 16:03
Show Gist options
  • Save manjula-dube/7886b041787c112a14b689fd2177eb5d to your computer and use it in GitHub Desktop.
Save manjula-dube/7886b041787c112a14b689fd2177eb5d to your computer and use it in GitHub Desktop.
!(function(e) {
function t(t) {
for (var r, a, c = t[0], l = t[1], i = t[2], s = 0, p = []; s < c.length; s++)
(a = c[s]), o[a] && p.push(o[a][0]), (o[a] = 0);
for (r in l) Object.prototype.hasOwnProperty.call(l, r) && (e[r] = l[r]);
for (f && f(t); p.length; ) p.shift()();
return u.push.apply(u, i || []), n();
}
function n() {
for (var e, t = 0; t < u.length; t++) {
for (var n = u[t], r = !0, c = 1; c < n.length; c++) {
var l = n[c];
0 !== o[l] && (r = !1);
}
r && (u.splice(t--, 1), (e = a((a.s = n[0]))));
}
return e;
}
var r = {},
o = { 1: 0 },
u = [];
function a(t) {
if (r[t]) return r[t].exports;
var n = (r[t] = { i: t, l: !1, exports: {} });
return e[t].call(n.exports, n, n.exports, a), (n.l = !0), n.exports;
}
(a.m = e),
(a.c = r),
(a.d = function(e, t, n) {
a.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n });
}),
(a.r = function(e) {
'undefined' != typeof Symbol &&
Symbol.toStringTag &&
Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
Object.defineProperty(e, '__esModule', { value: !0 });
}),
(a.t = function(e, t) {
if ((1 & t && (e = a(e)), 8 & t)) return e;
if (4 & t && 'object' == typeof e && e && e.__esModule) return e;
var n = Object.create(null);
if ((a.r(n), Object.defineProperty(n, 'default', { enumerable: !0, value: e }), 2 & t && 'string' != typeof e))
for (var r in e)
a.d(
n,
r,
function(t) {
return e[t];
}.bind(null, r)
);
return n;
}),
(a.n = function(e) {
var t =
e && e.__esModule
? function() {
return e.default;
}
: function() {
return e;
};
return a.d(t, 'a', t), t;
}),
(a.o = function(e, t) {
return Object.prototype.hasOwnProperty.call(e, t);
}),
(a.p = '');
var c = (window.webpackJsonp = window.webpackJsonp || []),
l = c.push.bind(c);
(c.push = t), (c = c.slice());
for (var i = 0; i < c.length; i++) t(c[i]);
var f = l;
u.push([0, 0]), n();
})({
0: function(e, t, n) {
e.exports = n('IszA');
},
IszA: function(e, t, n) {
'use strict';
var r =
Object.assign ||
function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
}
return e;
},
o = (function() {
function e(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
(r.enumerable = r.enumerable || !1),
(r.configurable = !0),
'value' in r && (r.writable = !0),
Object.defineProperty(e, r.key, r);
}
}
return function(t, n, r) {
return n && e(t.prototype, n), r && e(t, r), t;
};
})(),
u = c(n('q1tI')),
a = c(n('i8i4'));
function c(e) {
return e && e.__esModule ? e : { default: e };
}
function l(e, t) {
if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !t || ('object' != typeof t && 'function' != typeof t) ? e : t;
}
var i = (function(e) {
return (function(t) {
function n() {
var e, t, r;
!(function(e, t) {
if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function');
})(this, n);
for (var o = arguments.length, u = Array(o), a = 0; a < o; a++) u[a] = arguments[a];
return (
(t = r = l(this, (e = n.__proto__ || Object.getPrototypeOf(n)).call.apply(e, [this].concat(u)))),
(r.state = { count: 0 }),
(r.handleDecrement = function() {
r.setState({ count: r.state.count - 1 });
}),
(r.handleIncrement = function() {
r.setState({ count: r.state.count + 1 });
}),
l(r, t)
);
}
return (
(function(e, t) {
if ('function' != typeof t && null !== t)
throw new TypeError('Super expression must either be null or a function, not ' + typeof t);
(e.prototype = Object.create(t && t.prototype, {
constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 },
})),
t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : (e.__proto__ = t));
})(n, u.default.Component),
o(n, [
{
key: 'render',
value: function() {
var t = this.state.count;
return u.default.createElement(
e,
r({}, this.prop, { count: t, onIncrease: this.handleIncrement, onDecrease: this.handleDecrement })
);
},
},
]),
n
);
})();
})(function(e) {
var t = e.count,
n = e.onIncrease,
r = e.onDecrease;
return u.default.createElement(
'div',
null,
u.default.createElement('div', null, 'Current count: ', t),
u.default.createElement(
'div',
null,
u.default.createElement('button', { onClick: r }, '-'),
u.default.createElement('button', { onClick: n }, '+')
)
);
});
a.default.render(u.default.createElement(i, null), document.getElementById('root'));
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment