Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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')
});
@r7kamura

This comment has been minimized.

Copy link
Owner Author

r7kamura commented Oct 3, 2015

.root の中に「test」と表示するだけのサンプル

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.