I am sorry if this is a newbie non-rescript related question, but I cannot seem to find a solution to it.
I have a promise
that fetches data from an API. I am looking to perform operation on the fetched value and return the value.
let value = APIPromise -> Js.Promise.then_(value => {
Js.Promise.resolve(value+4)
},_)
The variable value
will have the type Js.Promise.t<int>
instead of int
. How can I transform Js.Promise.t<int>
to int
? Thanks.