The term interoperability refers to the ability for Reason programs to use existing JavaScript within Reason. BuckleScript provides an excellent system for using existing JavaScript code within Reason, and also makes it easy to use Reason code within JavaScript.
JavaScript interoperability
Using JavaScript in Reason
We've already seen how we can use raw JavaScript in Reason. Let's now focus on how to bind to existing JavaScript. To bind a value to a named reference, we typically use let. That binding can then be used in subsequent code. When the value we want to bind to lives is JavaScript, we use external. The external binding is like a let, in the sense that it can be used in subsequent code. Unlike let, external...