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 { Shadow, HTML, El } from 'typed-dom'; | |
class Component implements El { | |
private readonly dom = Shadow.section({ | |
style: HTML.style(`ul { width: 100px; }`), | |
content: HTML.ul([ | |
HTML.li(`item`), | |
]), | |
}); | |
public readonly element = this.dom.element; |
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
class ExIterable<T> implements Iterable<T> { | |
protected _source: Iterable<any>; // cheat to drop type param `R`. | |
protected _operator: Operator<any, T>; // cheat to drop type param `R`. | |
constructor(source: Iterable<T> = null) { | |
this._source = source; | |
this._operator = null; | |
} |
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
// # TypeScript compilation and bundling | |
// $ tsc -t es5 -m amd --moduleResolution node --outFile bundle.js mylib.ts src/a.ts src/b.ts | |
// ^~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~ | |
// # terminal | |
// $ node | |
// > require('./bundle.js') | |
// 1 2 | |
// { default: 3 } | |
// | |
// # browser console |