made with esnextbin
Created
April 8, 2016 10:54
-
-
Save ramnathv/b7d713d8f22d185de3b03201263d41d7 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 --> | |
<div id="app"></div> | |
</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
// 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" />, | |
) |
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", | |
"dependencies": { | |
"mithril": "0.2.3" | |
} | |
} |
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 _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