This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="./dist/steal.production.js" main></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Thanks @phillipskevin | |
function wrap(C) { | |
const instanceHandler = { | |
set(target, property, value, receiver) { | |
console.log(property, value); | |
return true; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Thanks @BigAB | |
class Counter { | |
constructor() { | |
setTimeout(this.onTick.bind(this), 1000); | |
} | |
onTick() { | |
const now = new Date(); | |
// want to call the set trap | |
this.hours = now.getHours(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<script type="module"> | |
import { merge, prepare, render } from 'https://unpkg.com/elementree' | |
function Hello (state) { | |
if (!state.email) state.requestUser() | |
return render` | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloThing extends HTMLElement { | |
static get observedAttributes () { | |
return ['thing'] | |
} | |
constructor () { | |
super() | |
this.attachShadow({ mode: 'open' }) | |
this.render() | |
} |