made with esnextbin
Created
October 1, 2016 09:19
-
-
Save wclr/3d381e9e49c443bfbdb1a7aedd9762d5 to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains hidden or 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 --> | |
</body> | |
</html> |
This file contains hidden or 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 | |
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') | |
}) |
This file contains hidden or 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", | |
"@cycle/dom": "*", | |
"xstream": "*", | |
"@cycle/xstream-run": "*", | |
"dependencies": { | |
"@cycle/xstream-run": "3.1.0", | |
"@cycle/dom": "12.2.5", | |
"xstream": "6.4.1" | |
} | |
} |
This file contains hidden or 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
/* | |
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