Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/node_modules/rxjs/operators/ |
Upload File : |
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var OuterSubscriber_1 = require('../OuterSubscriber'); var subscribeToResult_1 = require('../util/subscribeToResult'); /** * Emits the most recently emitted value from the source Observable whenever * another Observable, the `notifier`, emits. * * <span class="informal">It's like {@link sampleTime}, but samples whenever * the `notifier` Observable emits something.</span> * * <img src="./img/sample.png" width="100%"> * * Whenever the `notifier` Observable emits a value or completes, `sample` * looks at the source Observable and emits whichever value it has most recently * emitted since the previous sampling, unless the source has not emitted * anything since the previous sampling. The `notifier` is subscribed to as soon * as the output Observable is subscribed. * * @example <caption>On every click, sample the most recent "seconds" timer</caption> * var seconds = Rx.Observable.interval(1000); * var clicks = Rx.Observable.fromEvent(document, 'click'); * var result = seconds.sample(clicks); * result.subscribe(x => console.log(x)); * * @see {@link audit} * @see {@link debounce} * @see {@link sampleTime} * @see {@link throttle} * * @param {Observable<any>} notifier The Observable to use for sampling the * source Observable. * @return {Observable<T>} An Observable that emits the results of sampling the * values emitted by the source Observable whenever the notifier Observable * emits value or completes. * @method sample * @owner Observable */ function sample(notifier) { return function (source) { return source.lift(new SampleOperator(notifier)); }; } exports.sample = sample; var SampleOperator = (function () { function SampleOperator(notifier) { this.notifier = notifier; } SampleOperator.prototype.call = function (subscriber, source) { var sampleSubscriber = new SampleSubscriber(subscriber); var subscription = source.subscribe(sampleSubscriber); subscription.add(subscribeToResult_1.subscribeToResult(sampleSubscriber, this.notifier)); return subscription; }; return SampleOperator; }()); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var SampleSubscriber = (function (_super) { __extends(SampleSubscriber, _super); function SampleSubscriber() { _super.apply(this, arguments); this.hasValue = false; } SampleSubscriber.prototype._next = function (value) { this.value = value; this.hasValue = true; }; SampleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.emitValue(); }; SampleSubscriber.prototype.notifyComplete = function () { this.emitValue(); }; SampleSubscriber.prototype.emitValue = function () { if (this.hasValue) { this.hasValue = false; this.destination.next(this.value); } }; return SampleSubscriber; }(OuterSubscriber_1.OuterSubscriber)); //# sourceMappingURL=sample.js.map