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

react-countdown

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-countdown - npm Package Compare versions

Comparing version 2.3.3 to 2.3.4

5

dist/Countdown.d.ts

@@ -6,3 +6,3 @@ import * as React from 'react';

export interface CountdownProps extends React.Props<Countdown>, CountdownTimeDeltaFormatOptions, Omit<LegacyCountdownProps, 'onComplete'> {
readonly date?: Date | number | string;
readonly date: Date | number | string;
readonly controlled?: boolean;

@@ -22,3 +22,3 @@ readonly intervalDelay?: number;

readonly onTick?: CountdownTimeDeltaFn;
readonly onComplete?: CountdownTimeDeltaFn | LegacyCountdownProps['onComplete'];
readonly onComplete?: (timeDelta: CountdownTimeDelta, completedOnStart: boolean) => void | LegacyCountdownProps['onComplete'];
}

@@ -99,3 +99,2 @@ export interface CountdownRenderProps extends CountdownTimeDelta {

isStatus(status: CountdownStatus): boolean;
handleOnComplete: (timeDelta: CountdownTimeDelta) => void;
setTimeDeltaState(timeDelta: CountdownTimeDelta, status?: CountdownStatus, callback?: (timeDelta: CountdownTimeDelta) => void): void;

@@ -102,0 +101,0 @@ getApi(): CountdownApi;

17

dist/index.es.js

@@ -372,6 +372,2 @@ import { cloneElement, Component, createRef, createElement } from 'react';

_this.handleOnComplete = function (timeDelta) {
if (_this.props.onComplete) _this.props.onComplete(timeDelta);
};
if (props.date) {

@@ -469,7 +465,7 @@ var timeDelta = _this.calcTimeDelta();

if (!this.mounted) return;
var completedCallback;
var completing = timeDelta.completed && !this.state.timeDelta.completed;
var completedOnStart = timeDelta.completed && status === "STARTED";
if (!this.state.timeDelta.completed && timeDelta.completed) {
if (!this.props.overtime) this.clearTimer();
completedCallback = this.handleOnComplete;
if (completing && !this.props.overtime) {
this.clearTimer();
}

@@ -479,3 +475,6 @@

if (callback) callback(_this2.state.timeDelta);
if (completedCallback) completedCallback(_this2.state.timeDelta);
if (_this2.props.onComplete && (completing || completedOnStart)) {
_this2.props.onComplete(timeDelta, completedOnStart);
}
};

@@ -482,0 +481,0 @@

@@ -376,6 +376,2 @@ 'use strict';

_this.handleOnComplete = function (timeDelta) {
if (_this.props.onComplete) _this.props.onComplete(timeDelta);
};
if (props.date) {

@@ -473,7 +469,7 @@ var timeDelta = _this.calcTimeDelta();

if (!this.mounted) return;
var completedCallback;
var completing = timeDelta.completed && !this.state.timeDelta.completed;
var completedOnStart = timeDelta.completed && status === "STARTED";
if (!this.state.timeDelta.completed && timeDelta.completed) {
if (!this.props.overtime) this.clearTimer();
completedCallback = this.handleOnComplete;
if (completing && !this.props.overtime) {
this.clearTimer();
}

@@ -483,3 +479,6 @@

if (callback) callback(_this2.state.timeDelta);
if (completedCallback) completedCallback(_this2.state.timeDelta);
if (_this2.props.onComplete && (completing || completedOnStart)) {
_this2.props.onComplete(timeDelta, completedOnStart);
}
};

@@ -486,0 +485,0 @@

{
"name": "react-countdown",
"version": "2.3.3",
"version": "2.3.4",
"description": "A customizable countdown component for React.",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

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