Sha256: a328feac0b2fa8bdedbc38171442d56320f8ecbbcc44734876c5ca778e9125ce

Contents?: true

Size: 1.57 KB

Versions: 49

Compression:

Stored size: 1.57 KB

Contents

/** PURE_IMPORTS_START .._operators_sample PURE_IMPORTS_END */
import { sample as higherOrder } from '../operators/sample';
/**
 * 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
 */
export function sample(notifier) {
    return higherOrder(notifier)(this);
}
//# sourceMappingURL=sample.js.map

Version data entries

49 entries across 49 versions & 4 rubygems

Version Path
ilog-0.4.1 node_modules/rxjs/_esm5/operator/sample.js
ilog-0.4.0 node_modules/rxjs/_esm5/operator/sample.js
ilog-0.3.3 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-18.0.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.21.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.20.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.19.1 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.19.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.18.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.17.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.16.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.15.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.14.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.13.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.12.2 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.12.1 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.12.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.11.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.10.0 node_modules/rxjs/_esm5/operator/sample.js
govuk_publishing_components-17.9.0 node_modules/rxjs/_esm5/operator/sample.js