1 | import xs from 'xstream';
|
2 | import { adapt } from '@cycle/run/lib/adapt';
|
3 | import { fromEvent } from './fromEvent';
|
4 | var BodyDOMSource = (function () {
|
5 | function BodyDOMSource(_name) {
|
6 | this._name = _name;
|
7 | }
|
8 | BodyDOMSource.prototype.select = function (selector) {
|
9 |
|
10 | return this;
|
11 | };
|
12 | BodyDOMSource.prototype.elements = function () {
|
13 | var out = adapt(xs.of([document.body]));
|
14 | out._isCycleSource = this._name;
|
15 | return out;
|
16 | };
|
17 | BodyDOMSource.prototype.element = function () {
|
18 | var out = adapt(xs.of(document.body));
|
19 | out._isCycleSource = this._name;
|
20 | return out;
|
21 | };
|
22 | BodyDOMSource.prototype.events = function (eventType, options, bubbles) {
|
23 | if (options === void 0) { options = {}; }
|
24 | var stream;
|
25 | stream = fromEvent(document.body, eventType, options.useCapture, options.preventDefault);
|
26 | var out = adapt(stream);
|
27 | out._isCycleSource = this._name;
|
28 | return out;
|
29 | };
|
30 | return BodyDOMSource;
|
31 | }());
|
32 | export { BodyDOMSource };
|
33 |
|
\ | No newline at end of file |