UNPKG

cronometro-lib

Version:
32 lines (31 loc) 846 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Contador = void 0; const interval_1 = require("rxjs/internal/observable/interval"); const map_1 = require("rxjs/internal/operators/map"); const conversion_1 = require("./conversion"); /** * Cuenta de manera ascendente de 1 en 1 */ class Contador { /** * @ignore */ constructor(valorLimite = 5) { /** * @ignore */ this.valorLimite = -1; this.valorLimite = valorLimite; } /** * Cuenta de 0 hasta el limite establecido * @returns Observable<string> */ start() { return (0, interval_1.interval)(1000).pipe((0, map_1.map)((sg) => { return (0, conversion_1.convertirSgFormatoReloj)(sg, 1, this.valorLimite); })); } } exports.Contador = Contador;