Skip to content

Instantly share code, notes, and snippets.

@MelleB
Last active August 30, 2016 10:15
Show Gist options
  • Save MelleB/2de57da1bf7fd278d51da2a036727896 to your computer and use it in GitHub Desktop.
Save MelleB/2de57da1bf7fd278d51da2a036727896 to your computer and use it in GitHub Desktop.
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);
@MelleB
Copy link
Author

MelleB commented Aug 30, 2016

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; }'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment