Created
June 16, 2017 14:28
-
-
Save ascoders/3fc45945b95831c61b7157b047a492d6 to your computer and use it in GitHub Desktop.
dynamic-object-react-demo // source https://jsbin.com/wesafur
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>dynamic-object-react-demo</title> | |
<script src="https://fb.me/react-0.14.0.min.js"></script> | |
<script src="https://fb.me/react-dom-0.14.0.min.js"></script> | |
<script src="https://unpkg.com/dynamic-object@2.1.15/built/bundle.js"></script> | |
</head> | |
<body> | |
<div id='root'></div> | |
<script id="jsbin-javascript"> | |
"use strict"; | |
var dynamicObj = observable({ | |
a: 1 | |
}); | |
observe(function () { | |
console.log("dynamicObj.a has changed to", dynamicObj.a); | |
}); | |
dynamicObj.a = 2; | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">const dynamicObj = observable({ | |
a: 1 | |
}) | |
observe(() => { | |
console.log("dynamicObj.a has changed to", dynamicObj.a) | |
}) | |
dynamicObj.a = 2</script></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
"use strict"; | |
var dynamicObj = observable({ | |
a: 1 | |
}); | |
observe(function () { | |
console.log("dynamicObj.a has changed to", dynamicObj.a); | |
}); | |
dynamicObj.a = 2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment