(effect: EffectCallback, options?: HTMLDriverOptions)
| 34 | const noop = () => {}; |
| 35 | |
| 36 | export function makeHTMLDriver(effect: EffectCallback, options?: HTMLDriverOptions) { |
| 37 | if (!options) { options = {}; } |
| 38 | const modules = options.modules || defaultModules; |
| 39 | const toHTML = init(modules); |
| 40 | function htmlDriver(vnode$: Stream<VNode>, name: string): DOMSource { |
| 41 | const html$ = vnode$.map(toHTML); |
| 42 | html$.addListener({ |
| 43 | next: effect || noop, |
| 44 | error: noop, |
| 45 | complete: noop, |
| 46 | }); |
| 47 | return new HTMLSource(html$, name); |
| 48 | }; |
| 49 | return htmlDriver; |
| 50 | } |
no outgoing calls
no test coverage detected