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 LogViewer extends React.Component<any, any> { | |
// some parts are omitted for brevity, like store subscription, or the actions | |
public defaultPresenter = ({message}) => <div>{message}</div> | |
public render() { return ( | |
<ul> | |
<li> | |
{logStore.items.map( m => { | |
const P = m.presenter || this.defaultPresenter | |
return <P key={m.id} {...m} /> |
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+v8: 250ms | |
// chrome+v8: 5500ms | |
// edge+chakra: 3400ms | |
// node+chakra: ????? | |
var count = 1000; | |
var tests = 1000; | |
var items = []; |
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
{ | |
"photos": { | |
"items": [ | |
{ | |
"id":1, | |
"class":"Photo", | |
"caption":"Photo about the 120 year old facade", | |
"alternative":"image of the building", | |
"image": "{{runtime reference to a variant}}", | |
"variants": { |
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
var q = require('q'); | |
function doSomething(a, b) { | |
var defer = q.defer(); | |
return q.fcall( function() { return [a,b]}); | |
/// |
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
$data.Class.define("Types.A", null, null, { | |
}); | |
$data.Class.define("Types.B", null, null, { | |
}); | |
$data.Class.define("Types.C", [Types.A, Type.B], null, { }); | |
//the last line throws an error complaining about only object can be the arguments deep down in the construction process |