Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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).