Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Hermanya/use-suspense-today
⏳ Use React Suspense today, with any data fetching library
https://github.com/Hermanya/use-suspense-today
Last synced: 6 days ago
JSON representation
⏳ Use React Suspense today, with any data fetching library
- Host: GitHub
- URL: https://github.com/Hermanya/use-suspense-today
- Owner: Hermanya
- Created: 2019-09-22T21:59:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T11:08:35.000Z (almost 2 years ago)
- Last Synced: 2024-11-07T11:19:26.023Z (13 days ago)
- Language: TypeScript
- Homepage:
- Size: 3.53 MB
- Stars: 29
- Watchers: 3
- Forks: 2
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - use-suspense-today
README
# use-suspense-today
> Use React Suspense today, with any data fetching library
[![NPM](https://img.shields.io/npm/v/use-suspense-today.svg)](https://www.npmjs.com/package/use-suspense-today) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
## Install
```bash
npm install --save use-suspense-today
```## Usage
```tsx
import * as React from 'react'
import { useSuspense } from 'use-suspense-today'const Child = () => {
const { loading, data } = useApiThatIsNotSuspenseReady();
useSuspense(loading);
return {data};
};const Parent = () => {
return (
Loading...}>
);
};
```## License
MIT © [Hermanya](https://github.com/Hermanya)
---
This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).