Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
/ use-promise Public archive

Making Promises in your components a breeze 🌬️

License

Notifications You must be signed in to change notification settings

jonkoops/use-promise

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.