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.

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more