chocolate-hooks
v1.0.2
Published
a hook library for work
Downloads
6
Readme
🐳 预览
chocolate-hooks
⚡ 安装
使用 npm
npm install chocolate-hooks --save
使用 yarn
yarn add chocolate-hooks
☄️ 如何使用
import React from 'react'
import { useCountDown } from 'chocolate-hooks'
export const Example = () => {
const [date, setDate] = useState(undefined)
const [dateString, _] = useCountDown({
endTime: date,
format: 'dd天hh小时mm分ss秒',
diff: 1000,
onEnd: () => console.log('end'),
})
useEffect(() => {
setDate(Date.now() + 2 * 24 * 60 * 60 * 1000)
}, [])
return <>{dateString}</>
}
🔨 部署 Deploy
- 集成
GitHub Action
自动化部署,同时支持CodeQL
代码分析