Created
January 31, 2017 18:10
-
-
Save stisa/65e7abbe5a619c1dfe8a0d007e48d07b to your computer and use it in GitHub Desktop.
Ugly js ffi example, the name of the module is important
This file contains hidden or 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
| proc setItem (item:cstring,to:cstring){.importc, exportc:"localStorage.$1"} | |
| proc getItem (item:cstring):string{.importc, exportc:"localStorage.$1"} | |
| proc log(x:string) = {.emit :"console.log(`x`);"} | |
| localStorage.setItem("hi","world") | |
| log localStorage.getItem("hi") #> world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment