Last active
August 30, 2016 10:15
-
-
Save MelleB/2de57da1bf7fd278d51da2a036727896 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 xs from 'xstream'; | |
import {run} from '@cycle/xstream-run'; | |
import {makeDOMDriver, h1} from '@cycle/dom'; | |
function main(sources: any) { | |
const sinks = { | |
DOM: xs.periodic(1000).map(i => | |
h1('' + i + ' seconds elapsed')) | |
}; | |
return sinks; | |
} | |
// Fix: { Add [name:string]: Function } | |
const drivers: { [name:string]: Function } = { | |
'DOM': makeDOMDriver('#app') | |
}; | |
run(main, drivers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ERROR in ./src/app.ts
(18,11): error TS2345: Argument of type '{ 'DOM': Function; }' is not assignable to parameter of type '{ [name: string]: Function; }'.
Index signature is missing in type '{ 'DOM': Function; }'.