Open lancegliser opened 1 month ago
Latest commit: e5fde61a3f66dbd1faec5ee32cd1912090b79408
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
flowbite-react | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 23, 2024 2:17pm |
flowbite-react-storybook | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 23, 2024 2:17pm |
The changes introduce a debounce mechanism to the use-theme-mode
hook to improve performance by reducing the frequency of function calls. The handleSetMode
function was renamed and wrapped with a debounce function to delay its execution by 25 milliseconds. Additionally, the setModeInLS
function was updated to handle the "auto" mode by removing the local storage value if it exists.
File Path | Change Summary |
---|---|
packages/ui/src/hooks/use-theme-mode.ts |
- Added import debounce from "debounce"; for debouncing functionality. |
- Renamed handleSetMode to _handleSetMode and debounced it with 25ms delay. |
|
- Updated setModeInLS to handle "auto" mode by removing the local storage value. |
🌼 In the code where themes do sway, 🌙 A debounce comes to save the day. With functions timed, and storage clear, Our UI shines, no need to fear. 🐇 Hopping through the code we go, Making it smooth, like a rabbit's flow.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summarize the changes made and the motivation behind them.
Reference related issues using
#
followed by the issue number.1352