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

timer-countdown

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timer-countdown

A well designed ReactJs component for timer-counter

  • 0.2.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

timer-countdown

timer-countdown is a simple count down timer component using react, which takes time as an input in milliseconds with an optional input of which function to be invoked when the timer completes. Input - 1) time in milliseconds 2) a function passed as props that gets called when the counter is completed 3) a function passed as props that gets called at every tick of a second

Demo

https://stackblitz.com/edit/react-tjdsbw?file=CountdownTimer.css

Installation

yarn add timer-countdown

Usage

import CountdownTimer from 'timer-countdown';
import ReactDOM from 'react-dom';
import React from 'react';

const completed = () => {
  console.log('Timer has completed')
}

const tick = (milliseconds) => {
  console.log(millsieconds);
}

const props = {
 timeLeft : 56000, // time in milliseconds
 completeCallback: completed(), //function to be invoked when the countdown timer finishes
 tickCallback: tick()
}

const Example = () => (
  <div>
    <CountdownTimer {...this.props} />
  </div>
)

ReactDOM.render(<Example />, document.getElementById('root'))

Development

yarn
yarn dev

Test

yarn test

Build

yarn
yarn build

Publish

npm login
npm version patch
git add -A
git push origin master
npm publish

Keywords

FAQs

Package last updated on 17 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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