Created
October 25, 2018 07:30
-
-
Save shubhang93/41573191f6d10632954554c1073cdeca to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/qemopip
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"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://fb.me/react-15.1.0.js"></script> | |
<script src="https://fb.me/react-dom-15.1.0.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/mobx/4.3.0/mobx.umd.js"></script> | |
<div id="app"></div> | |
<script id="jsbin-javascript"> | |
"use strict"; | |
var _mobx = mobx; | |
var observable = _mobx.observable; | |
var autorun = _mobx.autorun; | |
var message = observable({ | |
title: "Foo", | |
author: { | |
name: "Michel" | |
}, | |
likes: ["John", "Sara"] | |
}); | |
autorun(function () { | |
console.log(message.likes); | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var {observable,autorun}=mobx | |
let message = observable({ | |
title: "Foo", | |
author: { | |
name: "Michel" | |
}, | |
likes: [ | |
"John", "Sara" | |
] | |
}) | |
autorun(()=>{ | |
console.log(message.likes) | |
})</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 _mobx = mobx; | |
var observable = _mobx.observable; | |
var autorun = _mobx.autorun; | |
var message = observable({ | |
title: "Foo", | |
author: { | |
name: "Michel" | |
}, | |
likes: ["John", "Sara"] | |
}); | |
autorun(function () { | |
console.log(message.likes); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment