UNPKG

1.16 kBJavaScriptView Raw
1import xs from 'xstream';
2import { adapt } from '@cycle/run/lib/adapt';
3import { fromEvent } from './fromEvent';
4var BodyDOMSource = /** @class */ (function () {
5 function BodyDOMSource(_name) {
6 this._name = _name;
7 }
8 BodyDOMSource.prototype.select = function (selector) {
9 // This functionality is still undefined/undecided.
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}());
32export { BodyDOMSource };
33//# sourceMappingURL=BodyDOMSource.js.map
\No newline at end of file