Cubetiq React Hook useCountDown with trigger
Go to file
Sambo Chea 689ff3cddb
All checks were successful
continuous-integration/drone/push Build is passing
Fixed timeout and dists for build and publish
2021-04-30 19:11:28 +07:00
dist Fixed timeout and dists for build and publish 2021-04-30 19:11:28 +07:00
example updated gitignore 2020-10-15 10:23:22 +07:00
src Fixed timeout and dists for build and publish 2021-04-30 19:11:28 +07:00
.drone.yml Add drone ci 2021-03-10 17:48:14 +07:00
.eslintignore init project 2020-08-28 14:32:14 +07:00
.eslintrc.js init project 2020-08-28 14:32:14 +07:00
.gitignore Updated git config 2021-04-30 17:42:03 +07:00
.npmignore add readme 2020-08-28 15:58:25 +07:00
.prettierignore init project 2020-08-28 14:32:14 +07:00
.prettierrc init project 2020-08-28 14:32:14 +07:00
babel.config.js init project 2020-08-28 14:32:14 +07:00
jest.config.js init project 2020-08-28 14:32:14 +07:00
package.json Fixed timeout and dists for build and publish 2021-04-30 19:11:28 +07:00
README.md Updated the version and add build 2021-03-10 18:02:12 +07:00
tsconfig.json updated jest __tests__ 2020-09-19 08:04:43 +07:00

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