UNPKG

1.33 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var xstream_1 = require("xstream");
4var adapt_1 = require("@cycle/run/lib/adapt");
5var fromEvent_1 = require("./fromEvent");
6var BodyDOMSource = /** @class */ (function () {
7 function BodyDOMSource(_name) {
8 this._name = _name;
9 }
10 BodyDOMSource.prototype.select = function (selector) {
11 // This functionality is still undefined/undecided.
12 return this;
13 };
14 BodyDOMSource.prototype.elements = function () {
15 var out = adapt_1.adapt(xstream_1.default.of([document.body]));
16 out._isCycleSource = this._name;
17 return out;
18 };
19 BodyDOMSource.prototype.element = function () {
20 var out = adapt_1.adapt(xstream_1.default.of(document.body));
21 out._isCycleSource = this._name;
22 return out;
23 };
24 BodyDOMSource.prototype.events = function (eventType, options, bubbles) {
25 if (options === void 0) { options = {}; }
26 var stream;
27 stream = fromEvent_1.fromEvent(document.body, eventType, options.useCapture, options.preventDefault);
28 var out = adapt_1.adapt(stream);
29 out._isCycleSource = this._name;
30 return out;
31 };
32 return BodyDOMSource;
33}());
34exports.BodyDOMSource = BodyDOMSource;
35//# sourceMappingURL=BodyDOMSource.js.map
\No newline at end of file