4 - locked
Obtains and splits a promise into its individual then, catch, and finally components, already bound and ready to be destructured.
then
catch
finally
The given object is forced to be a promise using Promise.resolve.
Promise.resolve
const { then, catch, finally } = unpack_promise(Promise.resolve(27));then(console.log); // 27 Copy
const { then, catch, finally } = unpack_promise(Promise.resolve(27));then(console.log); // 27
Generated using TypeDoc
Stability
4 - locked
Obtains and splits a promise into its individual
then
,catch
, andfinally
components, already bound and ready to be destructured.The given object is forced to be a promise using
Promise.resolve
.Example