0.0.3 • Published 2 years ago
@mhellams/mth-use-deferred-promise v0.0.3
MTH Use Deferred Promise
useDeferredPromise
is a custom React hook that provides a simple mechanism to create deferred promises within a React functional component. This can be useful for delaying the resolution of a promise until a later time or when a specific event occurs.
See this video
Installation
pnpm
pnpm add @mhellams/mth-use-deferred-promise
yarn
yarn add @mhellams/mth-use-deferred-promise
npm
npm install @mhellams/mth-use-deferred-promise
Import
ESM
import { useDeferredPromise } from '@mhellams/mth-use-deferred-promise';
CJS
const { useDeferredPromise } = require('@mhellams/mth-use-deferred-promise');