Skip to content

Instantly share code, notes, and snippets.

View isacjunior's full-sized avatar

Isac isacjunior

View GitHub Profile
var propertyWithObject = function propertyWithObject(prop, value) {
var _ref;
return (
(_ref = {}),
(_ref[prop] = value),
(_ref[prop + "-string"] = value + "-string"),
_ref
);
};
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
const propertyWithObject = (prop, value) => ({
[prop]: value,
[`${prop}-string`]: `${value}-string`
})
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var PersonClass = (function() {
function PersonClass(name) {
_classCallCheck(this, PersonClass);
var _createClass = (function() {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
class PersonClass {
constructor(name) {
this.name = name
}
sayName() {
console.log(this.name)
}
}
{
"plugins": [
["transform-react-jsx", { "pragma":"h" }]
]
}
import { h, render, Component } from "preact"
class Title extends Component {
state = {
defaultName: 'Isac'
}
render({ name }, { defaultName }) {
return <h1 class='title'>{name || defaultName}</h1>
}
return (
<div>
<h2>List</h2>
<ul class="list">
<li>Name One</li>
<li>Name Two</li>
</ul>
</div>
)
"scripts": {
"start": "parcel src/index.html -d dev",
"build": "parcel build src/index.html"
}