chocolate-hooks
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published
chocolate-hooks
chocolate-hooks npm chocolate-hooks netlify

🍫 Chocolate-Hooks

一个 React Hooks 库,提升开发效率

🐳 预览

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 代码分析

Readme

Keywords

Package Sidebar

Install

npm i chocolate-hooks

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

102 kB

Total Files

84

Last publish

Collaborators

  • echo_xsm