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
function __$createComponent() { | |
... | |
} | |
class MyComponent extends React.Component { | |
render(props) { | |
return [props.className, 0, props.items.length, __$createComponent] | |
} | |
_bytecode = [ |
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
Object.defineProperty(HTMLInputElement.prototype, 'autofocus', { | |
get() { | |
return this._autofocus || false; | |
}, | |
set(x) { | |
this._autofocus = x; | |
setTimeout(() => { | |
this.focus(); | |
}, 0); | |
return x; |
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
{ | |
// Use IntelliSense to learn about possible Node.js debug attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "attach", | |
"name": "Attach by Process ID", |
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
"use strict"; | |
class Example1 { | |
constructor() { | |
this.counter = 0; | |
this.settings = { | |
countTimes: 1000, | |
}; | |
// | |
const randomValue = false; |
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
'use strict' | |
var Benchmark = require('benchmark') | |
var suite = new Benchmark.Suite; | |
function createList() { | |
return [1, 2, 3, [[4]], [[[5]]], [6], [[7]]]; | |
} | |
function flattenRecursive (list) { |
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
// imagine if: | |
function MyComponent(props, state, update) { | |
return <div>{ props.foo }</div>; | |
} | |
// compiled to: | |
let MyComponent; |
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
/** | |
* React v16.0.0-alpha.3 | |
* | |
* Copyright 2013-present, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
* |
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
/** | |
* ReactDOMFiber v16.0.0-alpha.3 | |
* | |
* Copyright 2013-present, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
* |
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
// spec, both interfaces are lightweight objects that should be creatable in workers and on the main thread | |
createVirtualElement( | |
tagName: string, | |
ref?: Function, | |
key?: string, // or should it accept key like ES2015 Map keys do? | |
): VirtualElement | |
createVirtualTextNode( | |
text: string, | |
ref?: Function, |
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
function clickButton({ setState, state }) { | |
setState({ | |
counter: state.counter != null ? state.counter + 1 || 0 | |
}) | |
} | |
function StatefulComponent(props, state, setState) { | |
return <button onClick={ linkEvent({ setState, state }, clickButton) }>Number is { state.counter || 0 }</button> | |
} |