Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Console.log with return value

$
0
0

I’ve something similar,

let trace = (~label: string="", obj: 'a) => {
  Js.log2(label, obj)

  obj
}

I prefer this sort of helper to be in userspace. If we decided to add this as a built-in function, then we should introduce a Debug module in Core to add this helper. But really I think this should just be in userspace.


Viewing all articles
Browse latest Browse all 2592

Trending Articles