use-async-cache
v0.0.1
Published
 [](#) [ => {
const { cached } = useAsyncCache({
id: '1',
api: cache.fetch,
});
return <span>{cached && cached.data}</span>;
};import React from 'react';
import { Element } from './components/Element';
export default () => {
return Array(10)
.fill(0)
.map(() => <Element />);
};api.cache.fetch will only request once for 10 element
Author
👤 JW
- Twitter: @jiangweixian
- Github: @JiangWeixian
Show your support
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
