core.readablepromise
Home > @medplum/core > ReadablePromise
ReadablePromise class
The ReadablePromise class wraps a request promise suitable for React Suspense. See: https://blog.logrocket.com/react-suspense-data-fetching/\#wrappromise-js See: https://github.com/ovieokeh/suspense-data-fetching/blob/master/lib/api/wrapPromise.js
Signature:
export declare class ReadablePromise<T> implements Promise<T> 
Implements: Promise<T>
Constructors
Constructor  | Modifiers  | Description  | 
|---|---|---|
Constructs a new instance of the   | 
Properties
Property  | Modifiers  | Type  | Description  | 
|---|---|---|---|
  | string  | 
Methods
Method  | Modifiers  | Description  | 
|---|---|---|
Attaches a callback for only the rejection of the Promise.  | ||
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.  | ||
Returns true if the promise resolved successfully.  | ||
Returns true if the promise is pending.  | ||
Attempts to read the value of the promise. If the promise is pending, this method will throw a promise. If the promise rejected, this method will throw the rejection reason. If the promise resolved, this method will return the resolved value.  | ||
Attaches callbacks for the resolution and/or rejection of the Promise.  |