New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-cache-api

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cache-api

Save network request using cache.

latest
Source
npmnpm
Version
1.6.11
Version published
Maintainers
1
Created
Source

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.

Keywords

api

FAQs

Package last updated on 19 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts