Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-compound-timer

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-compound-timer - npm Package Compare versions

Comparing version 1.1.4 to 1.1.5

.DS_Store

1

build/lib/models/TimerModel.d.ts
import { TimeParts, Checkpoint, Direction, TimerValue, Unit } from '../../types';
export declare class TimerModel {
private initialTime;
private internalTime;
private time;

@@ -5,0 +6,0 @@ private direction;

@@ -11,2 +11,3 @@ "use strict";

var initialTime = _a.initialTime, direction = _a.direction, timeToUpdate = _a.timeToUpdate, lastUnit = _a.lastUnit, checkpoints = _a.checkpoints, onChange = _a.onChange;
this.internalTime = performance.now();
this.initialTime = initialTime;

@@ -40,2 +41,3 @@ this.time = initialTime;

TimerModel.prototype.setTime = function (time) {
this.internalTime = performance.now();
this.time = time;

@@ -79,2 +81,6 @@ };

if (callImmediately === void 0) { callImmediately = false; }
if (this.timerId) {
clearInterval(this.timerId);
}
this.internalTime = performance.now();
var repeatedFunc = function () {

@@ -101,8 +107,12 @@ var oldTime = _this.time;

if (this.innerState.isPlaying()) {
var currentInternalTime = performance.now();
var delta = Math.abs(currentInternalTime - this.internalTime);
switch (this.direction) {
case 'forward':
this.time = this.time + this.timeToUpdate;
this.time = this.time + delta;
this.internalTime = currentInternalTime;
return this.time;
case 'backward': {
this.time = this.time - this.timeToUpdate;
this.time = this.time - delta;
this.internalTime = currentInternalTime;
if (this.time < 0) {

@@ -109,0 +119,0 @@ this.stop();

2

package.json
{
"name": "react-compound-timer",
"version": "1.1.4",
"version": "1.1.5",
"description": "Timer compound react component",

@@ -5,0 +5,0 @@ "main": "build",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc