1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var xstream_1 = require("xstream");
|
4 | var adapt_1 = require("@cycle/run/lib/adapt");
|
5 | var fromEvent_1 = require("./fromEvent");
|
6 | var BodyDOMSource = (function () {
|
7 | function BodyDOMSource(_name) {
|
8 | this._name = _name;
|
9 | }
|
10 | BodyDOMSource.prototype.select = function (selector) {
|
11 |
|
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 | }());
|
34 | exports.BodyDOMSource = BodyDOMSource;
|
35 |
|
\ | No newline at end of file |