When a callback takes two or more arguments, it’s important to define it as uncurried or use @uncurry
, because something like this can produce invalid JS:
@val external test: ((int, int) => int) => unit = "test"
let fn = x => x
test(y => fn)
function fn(x) {
return x;
}
test(function (y) {
return fn;
});
But are there any such concerns when the callback takes 1 or 0 arguments?