It should be trivial to extend transact! to support promises.
The use case for this is to avoid unnecessary wrapping of native JS functionality. Promises are one of Js most used features so it makes sense to support it.
There are two ways that this can work:
use tool/async to transform it into a core async channel and then treat its result accordingly
add a then handler to the promise which will transact its result.
The first option handles error implicitedly, the second one lets the creator of the promise handle the error ....
It should be trivial to extend transact! to support promises.
The use case for this is to avoid unnecessary wrapping of native JS functionality. Promises are one of Js most used features so it makes sense to support it.
There are two ways that this can work:
tool/async
to transform it into a core async channel and then treat its result accordinglythen
handler to the promise which will transact its result.The first option handles error implicitedly, the second one lets the creator of the promise handle the error ....