This file contains 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 lang="en"> | |
<head> | |
<title>My page</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" /> | |
<script src="https://cdn.jsdelivr.net/combine/npm/[email protected]/umd/react.development.js,npm/[email protected]/umd/react-dom.development.js,npm/@material-ui/[email protected]/umd/material-ui.development.js,npm/@babel/[email protected]/babel.min.js" crossorigin="anonymous"></script> | |
<!-- Seperate Links | |
src: https://github.com/mui-org/material-ui/blob/master/examples/cdn/index.html --> |
This file contains 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
import { Component, h } from 'preact'; | |
import ListItem from '../list-item'; | |
export default class List extends Component<{}, { indices: number[] }> { | |
state = { indices: [0, 1, 2, 3] }; | |
public render() { | |
return ( |
This file contains 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
export class Deferred extends Promise { | |
constructor(executor) { | |
super( (resolve, reject) => { | |
this.resolve = resolve; | |
this.reject = reject; | |
if (executor) executor(resolve, reject); | |
}); | |
} | |
} |
This file contains 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
/** | |
* Our component structure will look like the following: | |
* - WikiBox | |
* -- AutoCompleteBox | |
* --- AutoComplete | |
*/ | |
/** Renders a single entity coming from wikipedia */ | |
class AutoComplete extends React.Component { | |
render() { |
This file contains 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
/** Slay and pillage an unprotected network! ...oh, we can't do that? | |
* Ok, let's publish an event instead, to a backdrop of flashing lights | |
* and clashing of metal on metal. | |
*/ | |
void vanquishOpenNetwork() { | |
if (!openNetworkCount || !strongest.rssi) { | |
return; | |
} | |
// allow the system to control the LED so we can see cloud connection progress |
This file contains 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
// Node style module writ in ES6 syntax: | |
export default foo = () => console.log(‘hi’) | |
// Unfortunately “literally” transpiles to this: | |
exports.default = function foo() { | |
return console.log(‘hi’) | |
} | |
// Which means this will fail: | |
var foo = require(‘./foo’) |