This repository illustrate the issue I'm facing to run Cycle.js Diversity with latest version of Brunch + ES6.
See brunch/brunch#1449.
## Witness the issue
- Clone this repo
npm install
npm start
- Go to http://localhost:3333/
- Open your DevTools, a wild error message should appear:
## Steps to reproduce this repo
- Let's consider you have Node.js and Brunch installed.
- Set up new repo from Brunch ES6 skeleton:
brunch new cyclejs-diversity-brunch -s es6
. - Install Cycle.js Diversity:
npm install xstream @cycle/xstream-run @cycle/dom
- Replace
app/index.js
with the following code:
import {run} from '@cycle/xstream-run';
import {div, label, input, hr, h1, makeDOMDriver} from '@cycle/dom';
function main(sources) {
const sinks = {
DOM: sources.DOM.select('.field').events('input')
.map(ev => ev.target.value)
.startWith('')
.map(name =>
div([
label('Name:'),
input('.field', {attrs: {type: 'text'}}),
hr(),
h1('Hello ' + name),
])
)
};
return sinks;
}
run(main, { DOM: makeDOMDriver('#app') });