Skip to content

Instantly share code, notes, and snippets.

@wclr
Created October 1, 2016 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wclr/3d381e9e49c443bfbdb1a7aedd9762d5 to your computer and use it in GitHub Desktop.
Save wclr/3d381e9e49c443bfbdb1a7aedd9762d5 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 -->
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
import {run} from '@cycle/xstream-run'
import {makeDOMDriver, div, button} from '@cycle/dom'
import xs from 'xstream'
import delay from 'xstream/extra/delay'
const {of, merge} = xs
//
const Main = ({DOM}) => {
return {
DOM: merge(
of(div('.wrapper', ['WRAPPER1']))
of(div('.wrapper', ['WRAPPER2', button('click')])).compose(delay(100))
)
}
}
run(Main, {
DOM: makeDOMDriver('body')
})
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"@cycle/dom": "*",
"xstream": "*",
"@cycle/xstream-run": "*",
"dependencies": {
"@cycle/xstream-run": "3.1.0",
"@cycle/dom": "12.2.5",
"xstream": "6.4.1"
}
}
/*
unknown: Unexpected token (15:6)
13 | DOM: merge(
14 | of(div('.wrapper', ['WRAPPER1']))
> 15 | of(div('.wrapper', ['WRAPPER2', button('click')])).compose(delay(100))
| ^
16 | )
17 | }
18 | }
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment