Cubetiq React Hook useCountDown with trigger
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Sambo Chea 689ff3cddb Fixed timeout and dists for build and publish 7 days ago
dist updated build and package 8 months ago
example updated gitignore 7 months ago
src Fixed timeout and dists for build and publish 7 days ago
.drone.yml Add drone ci 2 months ago
.eslintignore init project 8 months ago
.eslintrc.js init project 8 months ago
.gitignore remove unused packages deps and updates example and installation 7 months ago
.npmignore add readme 8 months ago
.prettierignore init project 8 months ago
.prettierrc init project 8 months ago
README.md Updated the version and add build 2 months ago
babel.config.js init project 8 months ago
jest.config.js init project 8 months ago
package.json Fixed timeout and dists for build and publish 7 days ago
tsconfig.json updated jest __tests__ 8 months ago

README.md

React Countdown Hook

Build Status

Installation

# NPM
npm i @cubetiq/react-use-countdown

# Yarn
yarn add @cubetiq/react-use-countdown

Example

import React from 'react';
import ReactDOM from 'react-dom';
// import the countdown hook here
import { useCountdown } from 'cubetiq-react-use-countdown';

const App = () => {
    const { timeleft, start } = useCountdown({
        step: 1000,
    });

    return (
        <div>
            <button onClick={() => start(10000)}>Start Countdown</button>
            <h1>Time left: {timeleft}</h1>
        </div>
    );
};

ReactDOM.render(<App />, document.querySelector('#root'));

Contributors

Project's repository: React Countdown