The purpose of such a function would be to chain a side effect based on the value of a promise. For example, setting some React state if a promise is successful or logging in between thens
Currently, this can be achieved with
let tap = (p, f) = Promise.thenResolve(p, v => {
f(v)
v
})
This lib tries to be runtime free as much as possible and also tries to stick to JS' promise apis.
Maybe something like this could end up in a dedicated utility module within Belt at some point.
Hey there, thanks for the great bindings!
Have you thought about adding a function like
The purpose of such a function would be to chain a side effect based on the value of a promise. For example, setting some React state if a promise is successful or logging in between
then
sCurrently, this can be achieved with