MCPcopy Create free account
hub / github.com/cyclejs/cyclejs / HTMLSource

Class HTMLSource

dom/src/HTMLSource.ts:6–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import {DOMSource, EventsFnOptions} from './DOMSource';
5
6export class HTMLSource implements DOMSource {
7 private _html$: Stream<string>;
8 private _empty$: Stream<any>;
9
10 constructor(html$: Stream<string>, private _name: string) {
11 this._html$ = html$;
12 this._empty$ = adapt(xs.empty());
13 }
14
15 public elements(): MemoryStream<string> {
16 const out: DevToolEnabledSource & MemoryStream<string> = adapt(this._html$);
17 out._isCycleSource = this._name;
18 return out;
19 }
20
21 public select(selector: string): DOMSource {
22 return new HTMLSource(xs.empty(), this._name);
23 }
24
25 public events(eventType: string, options?: EventsFnOptions): Stream<any> {
26 const out: Partial<DevToolEnabledSource> & Stream<any> = this._empty$;
27 out._isCycleSource = this._name;
28 return out;
29 }
30}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected