Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

zao95/react-cache-api

Repository files navigation

React Cache API

React Cache API is a React Hooks library for data fetching.

It was inspired by the swr.

Demo website

🚀Quick Overview

// Please wrap the component to call useCacheApi with this component.
// In the case of nextJS, it is recommended to wrap the component in the _app file.
<CacheApiConfig baseURL="https://yourapibaseurl">
    <Component />
</CacheApiConfig>
// If the response value is cached, return cached value.
// If not, request api through fetch.
const { data, error, isValidation } = useCacheApi('/', query)

// Even if you write without a query on another page, it gets the cached value.
const { data, error, isValidation } = useCacheApi('/')

✨Feature

  • When using the cache, it is not necessary to write the boiler plate code due to query.

👏 Contributing

Pull requests and 🌟 stars are always welcome.

For major changes, please open an issue first to discuss what you would like to change.

☕ Donate

📩 Contact

awmaker@kakao.com

Others

👍 We recommend third-party services with react-cache-api.

  • We recommand nextJS service for more convenient react use.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published