Sha256: 6175d65852919e650c7d4d433fa8d40b56f77c9b69a62b6315509fd079dad69c

Contents?: true

Size: 1.11 KB

Versions: 49

Compression:

Stored size: 1.11 KB

Contents

import { Subscriber } from '../Subscriber';
import { async } from '../scheduler/async';
export function timeInterval(scheduler = async) {
    return (source) => source.lift(new TimeIntervalOperator(scheduler));
}
export class TimeInterval {
    constructor(value, interval) {
        this.value = value;
        this.interval = interval;
    }
}
;
class TimeIntervalOperator {
    constructor(scheduler) {
        this.scheduler = scheduler;
    }
    call(observer, source) {
        return source.subscribe(new TimeIntervalSubscriber(observer, this.scheduler));
    }
}
/**
 * We need this JSDoc comment for affecting ESDoc.
 * @ignore
 * @extends {Ignored}
 */
class TimeIntervalSubscriber extends Subscriber {
    constructor(destination, scheduler) {
        super(destination);
        this.scheduler = scheduler;
        this.lastTime = 0;
        this.lastTime = scheduler.now();
    }
    _next(value) {
        let now = this.scheduler.now();
        let span = now - this.lastTime;
        this.lastTime = now;
        this.destination.next(new TimeInterval(value, span));
    }
}
//# sourceMappingURL=timeInterval.js.map

Version data entries

49 entries across 49 versions & 4 rubygems

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