This package has been deprecated

Author message:

Package is no longer supported. Install @jonkoops/use-promise instead.

@amsterdam/use-promise
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

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 @amsterdam/use-promise

Or npm:

npm install @amsterdam/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.

Package Sidebar

Install

npm i @amsterdam/use-promise

Weekly Downloads

61

Version

3.1.0

License

MPL-2.0

Unpacked Size

28.6 kB

Total Files

8

Last publish

Collaborators

  • vincent.smedinga
  • alimpens
  • dlnr
  • jthijsamsterdam
  • remyvdwereld
  • leonardsmit
  • datapunt-admin
  • fortunato