Last active
February 3, 2016 02:58
-
-
Save khle/ef60fa1fc4bf548beffd to your computer and use it in GitHub Desktop.
CycleSocket Chat main.js
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
| import {Observable} from 'rx'; | |
| import {run} from '@cycle/core'; | |
| import {h4, h2, div, label, nav, a, makeDOMDriver} from '@cycle/dom'; | |
| import {appBar} from './appBar.js'; | |
| import {chatPane} from './chatPane.js'; | |
| import {presencePane} from './presencePane.js'; | |
| import {textEntryView} from './textEntry.js'; | |
| function view(DOMSource) { | |
| const appBarView$ = appBar(DOMSource); | |
| const chatPaneView$ = chatPane(DOMSource); | |
| const presencePaneView$ = presencePane(DOMSource); | |
| const textEntryView$ = textEntryView(DOMSource); | |
| const vtree$ = Observable.of( | |
| div([ | |
| appBarView$, | |
| div({className: 'row'}, [ | |
| div({className: 'col s6'}, [ | |
| h4('Chat Messages'), | |
| textEntryView$, | |
| ]), | |
| div({className: 'col s6'}, [ | |
| presencePaneView$, | |
| ]), | |
| ]) | |
| ]) | |
| ); | |
| return vtree$; | |
| } | |
| function main(sources) { | |
| return { | |
| DOM: view(sources.DOM) | |
| }; | |
| } | |
| run(main, { | |
| DOM: makeDOMDriver('#app'), | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment