/** * Prefer [`use()`](https://react.dev/reference/react/use) than this * * @example * ```ts * function App() { * const p = usePromise(() => * fetch('https://swapi.dev/api/').then((r) => r.json()) * ) * if (p.status === 'pending') return 'Loading...' * if (p.status === 'rejected') return JSON.stringify(p.reason) * if (p.status === 'fulfilled') * return
{JSON.stringify(p.value, null, 4)}
* }
* ```
*/
export declare function usePromise