Created
December 8, 2016 17:20
-
-
Save sgrove/707d55a3874045287c142732932597b9 to your computer and use it in GitHub Desktop.
Example Reason+Bucklescript bindings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
external log : 'anything => unit = "console.log" [@@bs.val]; | |
external trace : 'anything => unit = "console.trace" [@@bs.val]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* vim: set ft=rust: | |
* vim: set ft=reason: | |
*/ | |
type element; | |
external getElementById : string => element = "document.getElementById" [@@bs.val]; | |
external querySelector : string => element = "document.querySelector" [@@bs.val]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type intervalId; | |
type timeoutId; | |
external setInterval : (unit => unit) => int => intervalId = "window.setInterval" [@@bs.val]; | |
external clearInterval : intervalId => unit = "window.clearInterval" [@@bs.val]; | |
external setTimeout : (unit => unit) => int => timeoutId = "window.setTimeout" [@@bs.val]; | |
external reload : unit => unit = "window.location.reload" [@@bs.val]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment