Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

jonkoops/use-promise

Folders and files

NameName
Last commit message
Last commit date
Oct 23, 2023
May 23, 2022
Jul 11, 2023
Mar 15, 2021
Aug 26, 2021
Aug 18, 2021
Mar 15, 2021
May 23, 2022
Mar 21, 2023
Jan 8, 2024
Aug 14, 2023
Mar 21, 2023
Mar 21, 2023
Mar 21, 2023

Repository files navigation

usePromise · License: MPL 2.0 npm version

Making Promises in your components a breeze 🌬️

Features

  • Handle the result of your Promises easily.
  • Familiar handling of side effects using useEffect.
  • Easy cancellation of fetch requests with AbortSignal.
  • TypeScript support out of the box.

For more information see the Getting Started guide.

Installation

Install usePromise using yarn:

yarn add @jonkoops/use-promise

Or npm:

npm install @jonkoops/use-promise

Guides

Compatibility

This library will work in every environment (Node or browser) that supports AbortController, AbortSignal, Promise.allSettled and async functions. If you need to support an environment that does not have these features make sure to include the appropriate polyfills and transformations.