-
Webapi.Performance is defined as: type t
@send external now: t => float = "now"
I ended up writing my own @val external performance: Webapi.Performance.t = "performance" Shouldn't this be equivalent to how @val external window: Dom.window = "window"
@val external document: Dom.document = "document" |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It's defined here it takes a window instance and returns a performance t instance. https://github.com/tinymce/rescript-webapi/blob/main/src/Webapi/Dom/Webapi__Dom__Window.res#L54 So |
Beta Was this translation helpful? Give feedback.
-
The thing to remember is we don't use implicit globals. The only exception we make is This is done both to better match the spec and also handle situations where a reference from a different window (such as an iframe) needs to be used. |
Beta Was this translation helpful? Give feedback.
It's defined here it takes a window instance and returns a performance t instance.
https://github.com/tinymce/rescript-webapi/blob/main/src/Webapi/Dom/Webapi__Dom__Window.res#L54
So
window->Window.performance->Performance.now
should work.