I found the doc on the Reason site (couldn’t find it on the Rescript site), and here’s the snippet for anyone else who might be interested:
let ignore: 'a => unit;
Discard the value of its argument and return (). For instance, ignore(f x) discards the result of the side-effecting function f. It is equivalent to f x; (), except that the latter may generate a compiler warning; writing ignore(f x) instead avoids the warning.
I would love to be more specific about my types and add more bindings. I just want to try out the quick prototyping approach which the official doc suggests.
Anyway, adding a ignore clears out the warning, thanks to @jacobp100, although I am still not clear why it appears.
I think it appears because the compiler cannot infer what the call to document["removeEventListener"]("click", handleClick) returns - and it wants to check you’re not ignoring any return values
You can also annotate that it returns nothing by writing (document["addEventListener"]("click", handleClick): unit) - and that gets rid of the error too