-
Notifications
You must be signed in to change notification settings - Fork 214
E.when
Turadg Aleahmad edited this page Mar 30, 2023
·
2 revisions
Use E.when(promise, onfulfilled)
instead of promise.then(onfulfilled)
.
E.when
produces tracking info necessary for our deep stacks. .then
, .catch
, .finally
, and await
do not.
Keep in mind that the onrejected
param to E.when
handles only rejection of promise argument. If you want a single rejection handler like the Promise provides,
promise.then(onfulfilled).catch(onrejected)
then use the promise returned by E.when
,
E.when(p, onfulfilled).catch(onrejected)
This wiki is for developing agoric-sdk. For help using Agoric SDK, see https://docs.agoric.com/ and https://agoric-sdk.pages.dev/