Created
May 9, 2017 14:07
-
-
Save aaronmcadam/11b7771c31e4c71af96e0be4e85f8e30 to your computer and use it in GitHub Desktop.
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
export function App (sources) { | |
const request$ = xs.periodic(3000) | |
.mapTo({ | |
url: 'http://localhost:3000', | |
category: 'api', | |
}); | |
const vtree$ = sources.HTTP.select('api') | |
.flatten() | |
.map(res => res.body) | |
.startWith({ | |
name: 'Loading...' | |
}) | |
.map(result => | |
div([ | |
h2('.label', `Name ${result.name}`) | |
]) | |
); | |
const sinks = { | |
DOM: vtree$, | |
HTTP: request$, | |
} | |
return sinks; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment