Skip to content

Instantly share code, notes, and snippets.

@shubhang93
Created October 25, 2018 07:30
Show Gist options
  • Save shubhang93/41573191f6d10632954554c1073cdeca to your computer and use it in GitHub Desktop.
Save shubhang93/41573191f6d10632954554c1073cdeca to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/qemopip
<!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>
"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