ReScript WebAPI
ReScript bindings for everything you need in the browser.
Installation
Section titled “Installation”Install the package using your favorite package manager:
npm i @rescript/webapi@experimentalbun i @rescript/webapi@experimentaland add @rescript/webapi to your rescript.json:
{ "dependencies": [ "@rescript/webapi" ]}After installing the package , you can use bindings for the various Web APIs as defined in MDN.
let location = WebAPI.Window.current->WebAPI.Window.location
// Access properties using `.`let href = location.href
// Invoke methods using the `->TypeModule.method`location->WebAPI.Location.reloadlet location = window.location;
let href = location.href;
location.reload();
export { location, href,}