Last active
October 3, 2015 11:11
-
-
Save r7kamura/59c394af95f35668085c to your computer and use it in GitHub Desktop.
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
import Cycle, { Rx } from '@cycle/core' | |
import { h, makeDOMDriver } from '@cycle/dom'; | |
const intent = (DOM) => { | |
return {}; | |
}; | |
const model = (actionMap) => { | |
return new Rx.Subject().startWith(1); | |
}; | |
const view = (stateStream) => { | |
return stateStream.map((state) => { | |
return h('div', [ | |
'test' | |
]); | |
}); | |
}; | |
const main = ({ DOM }) => { | |
const actionMap = intent(DOM); | |
const stateStream = model(actionMap); | |
const treeStream = view(stateStream); | |
return { | |
DOM: treeStream | |
}; | |
}; | |
Cycle.run(main, { | |
DOM: makeDOMDriver('.root') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.root の中に「test」と表示するだけのサンプル