Compare commits

...

3 Commits

5 changed files with 125 additions and 5805 deletions

2
.gitignore vendored
View File

@ -11,5 +11,3 @@
# Error File
yarn-error.log

View File

@ -1,27 +1,39 @@
# JS LIBRARY BOILERPLATE
# React Countdown Hook
JS Library boilerplate is include with
- Typescript
- Jest Test
- Pre commit Prettier
- Eslint
### Get Started
---
After View Sample Ready , Please Run
### Installation
```shell script
bash init.sh
# NPM
npm i @cubetiq/react-use-countdown
# Yarn
yarn add @cubetiq/react-use-countdown
```
This Script Will Reinit Project
- Delete Sample File and SRC and Test
- Clear src/index.ts
- Reinitialize Git
- Delete Example Folder
### Example
```js
import React from 'react';
import ReactDOM from 'react-dom';
// import the countdown hook here
import { useCountdown } from 'cubetiq-react-use-countdown';
After Done This , Please reconfig package json
- Name
- Description
- Git Repository Url
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](https://git.cubetiqs.com/CUBETIQ/react-use-countdown.git)
- [@s.long](https://git.cubetiqs.com/s.long)
- [@sombochea](https://git.cubetiqs.com/sombochea)
- [@cubetiq](https://git.cubetiqs.com/CUBETIQ)

View File

@ -1,16 +1,19 @@
import React from "react"
import ReactDOM from "react-dom"
import { useCountdown} from "cubetiq-react-use-countdown"
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()
const { timeleft, start } = useCountdown({
step: 1000,
});
return (
<div>
<button onClick={() => start(10000)}>Start Count down </button>
<h1>Hellos Ciybt {timeleft}</h1>
<button onClick={() => start(10000)}>Start Countdown</button>
<h1>Time left: {timeleft}</h1>
</div>
)
}
);
};
ReactDOM.render(<App /> , document.querySelector("#root"))
ReactDOM.render(<App />, document.querySelector('#root'));

View File

@ -1,12 +1,24 @@
{
"name": "@cubetiq/react-use-countdown",
"version": "1.10.5",
"description": "Count down with trigger",
"version": "1.10.6",
"description": "React Countdown with trigger",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"author": "SL",
"license": "MIT",
"private": false,
"contributors": [
{
"email": "s.long@cubetiqs.com",
"name": "@s.long",
"url": "https://git.cubetiqs.com/s.long"
},
{
"email": "sombochea@cubetiqs.com",
"name": "@SomboChea",
"url": "https://git.cubetiqs.com/sombochea"
}
],
"keywords": [
"javascript",
"typescript",
@ -62,468 +74,5 @@
"directories": {
"example": "example"
},
"dependencies": {
"abab": "^2.0.5",
"acorn": "^7.4.0",
"acorn-globals": "^6.0.0",
"acorn-jsx": "^5.3.1",
"acorn-walk": "^7.2.0",
"aggregate-error": "^3.1.0",
"ajv": "^6.12.5",
"ansi-colors": "^4.1.1",
"ansi-escapes": "^4.3.1",
"ansi-regex": "^5.0.0",
"ansi-styles": "^4.2.1",
"anymatch": "^3.1.1",
"argparse": "^1.0.10",
"arr-diff": "^4.0.0",
"arr-flatten": "^1.1.0",
"arr-union": "^3.1.0",
"array-unique": "^0.3.2",
"asn1": "^0.2.4",
"assert-plus": "^1.0.0",
"assign-symbols": "^1.0.0",
"astral-regex": "^2.0.0",
"asynckit": "^0.4.0",
"atob": "^2.1.2",
"aws-sign2": "^0.7.0",
"aws4": "^1.10.1",
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-jest-hoist": "^26.2.0",
"babel-preset-current-node-syntax": "^0.1.3",
"babel-preset-jest": "^26.3.0",
"balanced-match": "^1.0.0",
"base": "^0.11.2",
"bcrypt-pbkdf": "^1.0.2",
"brace-expansion": "^1.1.11",
"braces": "^3.0.2",
"browser-process-hrtime": "^1.0.0",
"browserslist": "^4.14.2",
"bs-logger": "^0.2.6",
"bser": "^2.1.1",
"buffer-from": "^1.1.1",
"cache-base": "^1.0.1",
"callsites": "^3.1.0",
"camelcase": "^5.3.1",
"caniuse-lite": "^1.0.30001131",
"capture-exit": "^2.0.0",
"caseless": "^0.12.0",
"chalk": "^4.1.0",
"char-regex": "^1.0.2",
"ci-info": "^2.0.0",
"class-utils": "^0.3.6",
"clean-stack": "^2.2.0",
"cli-cursor": "^3.1.0",
"cli-truncate": "^2.1.0",
"cliui": "^6.0.0",
"co": "^4.6.0",
"collect-v8-coverage": "^1.0.1",
"collection-visit": "^1.0.0",
"color-convert": "^2.0.1",
"color-name": "^1.1.4",
"combined-stream": "^1.0.8",
"commander": "^6.1.0",
"compare-versions": "^3.6.0",
"component-emitter": "^1.3.0",
"concat-map": "^0.0.1",
"convert-source-map": "^1.7.0",
"copy-descriptor": "^0.1.1",
"core-js-compat": "^3.6.5",
"core-util-is": "^1.0.2",
"cosmiconfig": "^7.0.0",
"cross-spawn": "^7.0.3",
"cssom": "^0.4.4",
"cssstyle": "^2.3.0",
"csstype": "^3.0.3",
"dashdash": "^1.14.1",
"data-urls": "^2.0.0",
"debug": "^4.1.1",
"decamelize": "^1.2.0",
"decimal.js": "^10.2.0",
"decode-uri-component": "^0.2.0",
"dedent": "^0.7.0",
"deep-is": "^0.1.3",
"deepmerge": "^4.2.2",
"define-properties": "^1.1.3",
"define-property": "^0.2.5",
"delayed-stream": "^1.0.0",
"detect-newline": "^3.1.0",
"diff-sequences": "^26.3.0",
"doctrine": "^3.0.0",
"domexception": "^2.0.1",
"ecc-jsbn": "^0.1.2",
"electron-to-chromium": "^1.3.570",
"emittery": "^0.7.1",
"emoji-regex": "^8.0.0",
"end-of-stream": "^1.4.4",
"enquirer": "^2.3.6",
"error-ex": "^1.3.2",
"es-abstract": "^1.18.0-next.0",
"es-to-primitive": "^1.2.1",
"escalade": "^3.1.0",
"escape-string-regexp": "^1.0.5",
"escodegen": "^1.14.3",
"eslint-scope": "^5.1.1",
"eslint-utils": "^2.1.0",
"eslint-visitor-keys": "^1.3.0",
"espree": "^7.3.0",
"esprima": "^4.0.1",
"esquery": "^1.3.1",
"esrecurse": "^4.3.0",
"estraverse": "^4.3.0",
"esutils": "^2.0.3",
"exec-sh": "^0.3.4",
"execa": "^4.0.3",
"exit": "^0.1.2",
"expand-brackets": "^2.1.4",
"expect": "^26.4.2",
"extend": "^3.0.2",
"extend-shallow": "^2.0.1",
"extglob": "^2.0.4",
"extsprintf": "^1.3.0",
"fast-deep-equal": "^3.1.3",
"fast-diff": "^1.2.0",
"fast-json-stable-stringify": "^2.1.0",
"fast-levenshtein": "^2.0.6",
"fb-watchman": "^2.0.1",
"figures": "^3.2.0",
"file-entry-cache": "^5.0.1",
"fill-range": "^7.0.1",
"find-up": "^4.1.0",
"find-versions": "^3.2.0",
"flat-cache": "^2.0.1",
"flatted": "^2.0.2",
"for-in": "^1.0.2",
"forever-agent": "^0.6.1",
"form-data": "^2.3.3",
"fragment-cache": "^0.2.1",
"fs.realpath": "^1.0.0",
"function-bind": "^1.1.1",
"functional-red-black-tree": "^1.0.1",
"gensync": "^1.0.0-beta.1",
"get-caller-file": "^2.0.5",
"get-own-enumerable-property-symbols": "^3.0.2",
"get-package-type": "^0.1.0",
"get-stdin": "^6.0.0",
"get-stream": "^5.2.0",
"get-value": "^2.0.6",
"getpass": "^0.1.7",
"glob": "^7.1.6",
"glob-parent": "^5.1.1",
"globals": "^11.12.0",
"graceful-fs": "^4.2.4",
"growly": "^1.3.0",
"har-schema": "^2.0.0",
"har-validator": "^5.1.5",
"has": "^1.0.3",
"has-flag": "^4.0.0",
"has-symbols": "^1.0.1",
"has-value": "^1.0.0",
"has-values": "^1.0.0",
"hosted-git-info": "^2.8.8",
"html-encoding-sniffer": "^2.0.1",
"html-escaper": "^2.0.2",
"http-signature": "^1.2.0",
"human-signals": "^1.1.1",
"iconv-lite": "^0.4.24",
"ignore": "^4.0.6",
"import-fresh": "^3.2.1",
"import-local": "^3.0.2",
"imurmurhash": "^0.1.4",
"indent-string": "^4.0.0",
"inflight": "^1.0.6",
"inherits": "^2.0.4",
"invariant": "^2.2.4",
"ip-regex": "^2.1.0",
"is-accessor-descriptor": "^1.0.0",
"is-arrayish": "^0.2.1",
"is-buffer": "^1.1.6",
"is-callable": "^1.2.1",
"is-ci": "^2.0.0",
"is-data-descriptor": "^1.0.0",
"is-date-object": "^1.0.2",
"is-descriptor": "^1.0.2",
"is-docker": "^2.1.1",
"is-extendable": "^0.1.1",
"is-extglob": "^2.1.1",
"is-fullwidth-code-point": "^3.0.0",
"is-generator-fn": "^2.1.0",
"is-glob": "^4.0.1",
"is-negative-zero": "^2.0.0",
"is-number": "^3.0.0",
"is-obj": "^1.0.1",
"is-plain-object": "^2.0.4",
"is-potential-custom-element-name": "^1.0.0",
"is-regex": "^1.1.1",
"is-regexp": "^1.0.0",
"is-stream": "^2.0.0",
"is-symbol": "^1.0.3",
"is-typedarray": "^1.0.0",
"is-windows": "^1.0.2",
"is-wsl": "^2.2.0",
"isarray": "^1.0.0",
"isexe": "^2.0.0",
"isobject": "^3.0.1",
"isstream": "^0.1.2",
"istanbul-lib-coverage": "^3.0.0",
"istanbul-lib-instrument": "^4.0.3",
"istanbul-lib-report": "^3.0.0",
"istanbul-lib-source-maps": "^4.0.0",
"istanbul-reports": "^3.0.2",
"jest-changed-files": "^26.3.0",
"jest-cli": "^26.4.2",
"jest-config": "^26.4.2",
"jest-diff": "^26.4.2",
"jest-docblock": "^26.0.0",
"jest-each": "^26.4.2",
"jest-environment-jsdom": "^26.3.0",
"jest-environment-node": "^26.3.0",
"jest-get-type": "^26.3.0",
"jest-haste-map": "^26.3.0",
"jest-jasmine2": "^26.4.2",
"jest-leak-detector": "^26.4.2",
"jest-matcher-utils": "^26.4.2",
"jest-message-util": "^26.3.0",
"jest-mock": "^26.3.0",
"jest-pnp-resolver": "^1.2.2",
"jest-regex-util": "^26.0.0",
"jest-resolve": "^26.4.0",
"jest-resolve-dependencies": "^26.4.2",
"jest-runner": "^26.4.2",
"jest-runtime": "^26.4.2",
"jest-serializer": "^26.3.0",
"jest-snapshot": "^26.4.2",
"jest-util": "^26.3.0",
"jest-validate": "^26.4.2",
"jest-watcher": "^26.3.0",
"jest-worker": "^26.3.0",
"js-tokens": "^4.0.0",
"js-yaml": "^3.14.0",
"jsbn": "^0.1.1",
"jsdom": "^16.4.0",
"jsesc": "^2.5.2",
"json-parse-even-better-errors": "^2.3.1",
"json-schema": "^0.2.3",
"json-schema-traverse": "^0.4.1",
"json-stable-stringify-without-jsonify": "^1.0.1",
"json-stringify-safe": "^5.0.1",
"json5": "^2.1.3",
"jsprim": "^1.4.1",
"kind-of": "^3.2.2",
"kleur": "^3.0.3",
"leven": "^3.1.0",
"levenary": "^1.1.1",
"levn": "^0.4.1",
"lines-and-columns": "^1.1.6",
"listr2": "^2.6.2",
"locate-path": "^5.0.0",
"lodash": "^4.17.20",
"lodash.memoize": "^4.1.2",
"lodash.sortby": "^4.7.0",
"log-symbols": "^4.0.0",
"log-update": "^4.0.0",
"loose-envify": "^1.4.0",
"make-dir": "^3.1.0",
"make-error": "^1.3.6",
"makeerror": "^1.0.11",
"map-cache": "^0.2.2",
"map-visit": "^1.0.0",
"merge-stream": "^2.0.0",
"micromatch": "^4.0.2",
"mime-db": "^1.44.0",
"mime-types": "^2.1.27",
"mimic-fn": "^2.1.0",
"minimatch": "^3.0.4",
"minimist": "^1.2.5",
"mixin-deep": "^1.3.2",
"mkdirp": "^1.0.4",
"ms": "^2.1.2",
"nanomatch": "^1.2.13",
"natural-compare": "^1.4.0",
"nice-try": "^1.0.5",
"node-int64": "^0.4.0",
"node-modules-regexp": "^1.0.0",
"node-notifier": "^8.0.0",
"node-releases": "^1.1.61",
"normalize-package-data": "^2.5.0",
"normalize-path": "^3.0.0",
"npm-run-path": "^4.0.1",
"nwsapi": "^2.2.0",
"oauth-sign": "^0.9.0",
"object-copy": "^0.1.0",
"object-inspect": "^1.8.0",
"object-keys": "^1.1.1",
"object-visit": "^1.0.1",
"object.assign": "^4.1.1",
"object.pick": "^1.3.0",
"once": "^1.4.0",
"onetime": "^5.1.2",
"opencollective-postinstall": "^2.0.3",
"optionator": "^0.9.1",
"p-each-series": "^2.1.0",
"p-finally": "^1.0.0",
"p-limit": "^2.3.0",
"p-locate": "^4.1.0",
"p-map": "^4.0.0",
"p-try": "^2.2.0",
"parent-module": "^1.0.1",
"parse-json": "^5.1.0",
"parse5": "^5.1.1",
"pascalcase": "^0.1.1",
"path-exists": "^4.0.0",
"path-is-absolute": "^1.0.1",
"path-key": "^2.0.1",
"path-parse": "^1.0.6",
"path-type": "^4.0.0",
"performance-now": "^2.1.0",
"picomatch": "^2.2.2",
"pirates": "^4.0.1",
"pkg-dir": "^4.2.0",
"please-upgrade-node": "^3.2.0",
"posix-character-classes": "^0.1.1",
"prelude-ls": "^1.1.2",
"prettier-linter-helpers": "^1.0.0",
"pretty-format": "^26.4.2",
"progress": "^2.0.3",
"prompts": "^2.3.2",
"psl": "^1.8.0",
"pump": "^3.0.0",
"punycode": "^2.1.1",
"qs": "^6.5.2",
"react-is": "^16.13.1",
"read-pkg": "^5.2.0",
"read-pkg-up": "^7.0.1",
"regenerate": "^1.4.1",
"regenerate-unicode-properties": "^8.2.0",
"regenerator-runtime": "^0.13.7",
"regenerator-transform": "^0.14.5",
"regex-not": "^1.0.2",
"regexpp": "^3.1.0",
"regexpu-core": "^4.7.0",
"regjsgen": "^0.5.2",
"regjsparser": "^0.6.4",
"remove-trailing-separator": "^1.1.0",
"repeat-element": "^1.1.3",
"repeat-string": "^1.6.1",
"request": "^2.88.2",
"request-promise-core": "^1.1.4",
"request-promise-native": "^1.0.9",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"resolve": "^1.17.0",
"resolve-cwd": "^3.0.0",
"resolve-from": "^5.0.0",
"resolve-url": "^0.2.1",
"restore-cursor": "^3.1.0",
"ret": "^0.1.15",
"rimraf": "^3.0.2",
"rsvp": "^4.8.5",
"rxjs": "^6.6.3",
"safe-buffer": "^5.2.1",
"safe-regex": "^1.1.0",
"safer-buffer": "^2.1.2",
"sane": "^4.1.0",
"saxes": "^5.0.1",
"semver": "^5.7.1",
"semver-compare": "^1.0.0",
"semver-regex": "^2.0.0",
"set-blocking": "^2.0.0",
"set-value": "^2.0.1",
"shebang-command": "^2.0.0",
"shebang-regex": "^3.0.0",
"shellwords": "^0.1.1",
"signal-exit": "^3.0.3",
"sisteransi": "^1.0.5",
"slash": "^3.0.0",
"slice-ansi": "^2.1.0",
"snapdragon": "^0.8.2",
"snapdragon-node": "^2.1.1",
"snapdragon-util": "^3.0.1",
"source-map": "^0.6.1",
"source-map-resolve": "^0.5.3",
"source-map-support": "^0.5.19",
"source-map-url": "^0.4.0",
"spdx-correct": "^3.1.1",
"spdx-exceptions": "^2.3.0",
"spdx-expression-parse": "^3.0.1",
"spdx-license-ids": "^3.0.6",
"split-string": "^3.1.0",
"sprintf-js": "^1.0.3",
"sshpk": "^1.16.1",
"stack-utils": "^2.0.2",
"static-extend": "^0.1.2",
"stealthy-require": "^1.1.1",
"string-argv": "^0.3.1",
"string-length": "^4.0.1",
"string-width": "^4.2.0",
"string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1",
"stringify-object": "^3.3.0",
"strip-ansi": "^6.0.0",
"strip-bom": "^4.0.0",
"strip-eof": "^1.0.0",
"strip-final-newline": "^2.0.0",
"strip-json-comments": "^3.1.1",
"supports-color": "^7.2.0",
"supports-hyperlinks": "^2.1.0",
"symbol-tree": "^3.2.4",
"table": "^5.4.6",
"terminal-link": "^2.1.1",
"test-exclude": "^6.0.0",
"text-table": "^0.2.0",
"throat": "^5.0.0",
"through": "^2.3.8",
"tmpl": "^1.0.4",
"to-fast-properties": "^2.0.0",
"to-object-path": "^0.3.0",
"to-regex": "^3.0.2",
"to-regex-range": "^5.0.1",
"tough-cookie": "^2.5.0",
"tr46": "^2.0.2",
"tslib": "^1.13.0",
"tsutils": "^3.17.1",
"tunnel-agent": "^0.6.0",
"tweetnacl": "^0.14.5",
"type-check": "^0.3.2",
"type-detect": "^4.0.8",
"type-fest": "^0.8.1",
"typedarray-to-buffer": "^3.1.5",
"unicode-canonical-property-names-ecmascript": "^1.0.4",
"unicode-match-property-ecmascript": "^1.0.4",
"unicode-match-property-value-ecmascript": "^1.2.0",
"unicode-property-aliases-ecmascript": "^1.1.0",
"union-value": "^1.0.1",
"unset-value": "^1.0.0",
"uri-js": "^4.4.0",
"urix": "^0.1.0",
"use": "^3.1.1",
"uuid": "^8.3.0",
"v8-compile-cache": "^2.1.1",
"v8-to-istanbul": "^5.0.1",
"validate-npm-package-license": "^3.0.4",
"verror": "^1.10.0",
"w3c-hr-time": "^1.0.2",
"w3c-xmlserializer": "^2.0.0",
"walker": "^1.0.7",
"webidl-conversions": "^6.1.0",
"whatwg-encoding": "^1.0.5",
"whatwg-mimetype": "^2.3.0",
"whatwg-url": "^8.2.2",
"which": "^2.0.2",
"which-module": "^2.0.0",
"which-pm-runs": "^1.0.0",
"word-wrap": "^1.2.3",
"wrap-ansi": "^6.2.0",
"wrappy": "^1.0.2",
"write": "^1.0.3",
"write-file-atomic": "^3.0.3",
"ws": "^7.3.1",
"xml-name-validator": "^3.0.0",
"xmlchars": "^2.2.0",
"y18n": "^4.0.0",
"yaml": "^1.10.0",
"yargs": "^15.4.1",
"yargs-parser": "^18.1.3"
}
"dependencies": {}
}

File diff suppressed because it is too large Load Diff