DEV Community

Rafael De Leon
Rafael De Leon

Posted on

Prelude to react-hook-use-cta (useCTA)

Introduction

In the past, I found myself writing a React.useReducer hook that did common patterns of updating, setting, or comparing my current state with previous or initial state. Instead of having to rewrite this hook everywhere I went, I decided to turn it into a hook library in case I needed it in other projects.

It's current version is in prerelease version 0.0.1 since I think the Typescript and some of the API could be improved.

I provided extensive documentation on the hook's API in the README.md and provided a Demo playground for people to see the hook in action.

I did what I could to help intelli-sense through Typescript when it comes to defining custom actions and dispatch parameters.

I want to send this out into the wild to see if it helps and get some input. Thanks for reading.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay