Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Created April 8, 2016 10:54
Show Gist options
  • Save ramnathv/b7d713d8f22d185de3b03201263d41d7 to your computer and use it in GitHub Desktop.
Save ramnathv/b7d713d8f22d185de3b03201263d41d7 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!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 -->
<div id="app"></div>
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
/** @jsx m */
import m from 'mithril'
import {mount as render} from 'mithril'
const App = {
view(ctrl, props){
return <h2>{props.name}</h2>
}
}
render(
document.getElementById("app"),
<App name="Hello" />,
)
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"mithril": "0.2.3"
}
}
'use strict';
var _mithril = require('mithril');
var _mithril2 = _interopRequireDefault(_mithril);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
/** @jsx m */
var App = {
view: function view(ctrl, props) {
return (0, _mithril2.default)(
'h2',
null,
props.name
);
}
};
(0, _mithril.mount)(document.getElementById("app"), (0, _mithril2.default)(App, { name: 'Hello' }));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment