Chaining on a JsFuture

I have:

x: JsFuture; //
f: fn (JsValue) -> T;

is there a way to chain the two to get an object of type Future<T> ?

Basically I want to await on the x, apply f, and return.

How about this?

let fut = async move { f(x.await) };
1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.