← Back to index

How to access global functions in ReScript?

Sat Dec 12 2020

ReScript version: bs-platform@8.4.2

Use the @bs.val annotation:

@bs.val external setTimeout : (unit => unit, int) => float = "setTimeout";

let _ = setTimeout(() => {
  Js.log("Hello")
}, 2000)