Cubetiq React Hook useCountDown with trigger
Go to file
Sambo Chea 3ec76dcb62 remove unused packages deps and updates example and installation 2020-10-09 18:03:01 +07:00
dist fixed the publish and remove publish command 2020-09-19 16:06:18 +07:00
example remove unused packages deps and updates example and installation 2020-10-09 18:03:01 +07:00
src fixed the publish and remove publish command 2020-09-19 16:06:18 +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 remove unused packages deps and updates example and installation 2020-10-09 18:03:01 +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 remove unused packages deps and updates example and installation 2020-10-09 18:03:01 +07:00
README.md remove unused packages deps and updates example and installation 2020-10-09 18:03:01 +07:00
tsconfig.json updated jest __tests__ 2020-09-19 08:04:43 +07:00
yarn-error.log update example 2020-08-28 15:40:28 +07:00

React Countdown Hook

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 { useCountdown } from 'cubetiq-react-use-countdown';

const App = () => {
    const { timeleft, start } = useCountdown();
    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: https://git.cubetiqs.com/CUBETIQ/react-use-countdown.git