book-exploring-async-basics icon indicating copy to clipboard operation
book-exploring-async-basics copied to clipboard

[Translation] 7_0_introducing_our_main_example

Open Jaxx4Fun opened this issue 5 years ago • 1 comments

Now the parameter _res is an argument that is passed into our callback. In javascript it would be left out, but since we use a typed language we have created a type called Js.

So you wanted to make use of enum in Rust to unify the parameter _res, right?

In the case of set_timeout it's Js::undefined. In the case of Fs::read it's an Js::String and so on.

And it in the sentence above refers to the type of parameter _res.

Jaxx4Fun avatar May 27 '20 13:05 Jaxx4Fun

So you wanted to make use of enum in Rust to unify the parameter _res, right?

Yes

And it in the sentence above refers to the type of parameter _res.

Yes, that's right.

cfsamson avatar May 27 '20 19:05 cfsamson