HsPromise is a custom implementation of a promise-like object. It provides methods for handling asynchronous operations, including then, catch, and finally.
HsPromise
then
catch
finally
Creates a new HsPromise instance.
Optional
A function that is executed immediately, with resolve and reject callbacks.
resolve
reject
Attaches a callback for when the promise is rejected.
A callback to execute when the promise is rejected.
A new HsPromise that resolves or rejects based on the provided callback.
Attaches a callback that is executed when the promise is settled, regardless of its outcome.
A callback to execute when the promise is settled.
A new HsPromise that resolves or rejects based on the original promise.
Rejects the promise with the specified reason.
The reason for rejecting the promise.
Resolves the promise with the specified value.
The value to resolve the promise with.
Attaches callbacks for the fulfillment and rejection of the promise.
A callback to execute when the promise is fulfilled.
A new HsPromise that resolves or rejects based on the provided callbacks.
HsPromise
is a custom implementation of a promise-like object. It provides methods for handling asynchronous operations, includingthen
,catch
, andfinally
.