made with esnextbin
Created
March 8, 2016 23:16
-
-
Save nfcampos/705c828775c635db8aeb to your computer and use it in GitHub Desktop.
esnextbin sketch
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<!-- put markup and other contents here --> | |
</body> | |
</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
const realConstructor = React.Component.prototype.constructor | |
React.Component.prototype.constructor = function(...args) { | |
realConstructor(...args) | |
return new Proxy(this, boom) | |
} | |
const boom = { | |
get: function(target, name) { | |
if (newVersionOfPropertyIsAvailable) | |
return newVersionOfProperty | |
else | |
return target[name] | |
} | |
} |
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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0" | |
} |
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 realConstructor = React.Component.prototype.constructor; | |
React.Component.prototype.constructor = function () { | |
realConstructor.apply(undefined, arguments); | |
return new Proxy(this, boom); | |
}; | |
var boom = { | |
get: function get(target, name) { | |
if (newVersionOfPropertyIsAvailable) return newVersionOfProperty;else return target[name]; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment