Skip to content

Instantly share code, notes, and snippets.

@ntilwalli
Last active November 8, 2016 15:23
Show Gist options
  • Save ntilwalli/4367d2779f21988d5d4b35742fc57797 to your computer and use it in GitHub Desktop.
Save ntilwalli/4367d2779f21988d5d4b35742fc57797 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>
<div id="app-main"></div>
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
//import Cycle from '@cycle/xstream-run'
import {run} from '@cycle/xstream-run'
import {makeDOMDriver, div} from '@cycle/dom'
import isolate from '@cycle/isolate'
import O from 'xstream'
//import O from 'xstream'
function main(sources) {
return {
DOM: O.of(div([`Hello`]))
}
}
run(main, {
DOM: makeDOMDriver('#app-main')
})
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"@cycle/dom": "14.0.0",
"@cycle/isolate": "1.4.0",
"xstream": "7.0.0",
"@cycle/xstream-run": "3.1.0"
}
}
'use strict';
var _xstreamRun = require('@cycle/xstream-run');
var _dom = require('@cycle/dom');
var _isolate = require('@cycle/isolate');
var _isolate2 = _interopRequireDefault(_isolate);
var _xstream = require('xstream');
var _xstream2 = _interopRequireDefault(_xstream);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//import O from 'xstream'
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
//import Cycle from '@cycle/xstream-run'
function main(sources) {
return {
DOM: _xstream2.default.of((0, _dom.div)(['Hello']))
};
}
(0, _xstreamRun.run)(main, {
DOM: (0, _dom.makeDOMDriver)('#app-main')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment