Skip to content

feat(useCountdown): add autoStart and onFinish options#716

Open
joaobibiano wants to merge 2 commits intojuliencrn:masterfrom
joaobibiano:feat/use-countdown-onfinish-autostart
Open

feat(useCountdown): add autoStart and onFinish options#716
joaobibiano wants to merge 2 commits intojuliencrn:masterfrom
joaobibiano:feat/use-countdown-onfinish-autostart

Conversation

@joaobibiano
Copy link

@joaobibiano joaobibiano commented Mar 2, 2026

Description

Adds two new options to useCountdown to simplify consumption and avoid extra useEffect usage in user-land:

  • autoStart?: boolean to start the countdown on mount
  • onFinish?: () => void callback fired when countStop is reached

Type of change

  • ✨ New feature
  • 🐛 Bug fix
  • 💥 Breaking change
  • 🧪 Tests
  • 📚 Documentation

What changed

  • Updated useCountdown options and implementation
  • Added tests for autoStart and onFinish
  • Updated hook docs/demo
  • Added changeset for package version bump

Testing

  • pnpm -C packages/usehooks-ts test useCountdown
  • pnpm -C packages/usehooks-ts lint (fails in this environment due to missing eslint-plugin-import)

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2026

🦋 Changeset detected

Latest commit: b3510de

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
usehooks-ts Patch
www Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant