MF / Journal
← Project archive

Project case study

Hardtail - A data fetching library for React

Hardtail is a data fetching library for React that allows you to fetch data in a declarative way.

Published
StackReact · fetchApi · Context API

Hardtail

Hardtail is a data fetching library for React. It's designed to be used with React Hooks.

I've used the context API to store the data and the fetch API to fetch the data. I've also used the useReducer hook to manage the state of the data.

We also get hooks for fetching data, updating data, deleting data and creating data.

Usage

const { data, error, isLoading, reload } = useGetPosts();

const [updatePost, { data, error, isLoading }] = useUpdatePost();

Features

  • Fetch data from an API
  • Store the data in the context API
  • Use the data in the components