Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Document "@as(jsonxxx)" #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cristianoc opened this issue Sep 7, 2022 · 2 comments Β· Fixed by #1021
Closed

Document "@as(jsonxxx)" #550

cristianoc opened this issue Sep 7, 2022 · 2 comments Β· Fixed by #1021
Milestone

Comments

@cristianoc
Copy link
Contributor

Looks like this is missing in the documentation.

@module("library-x") @val
external doStuff: (@as(json`{format:"utf8", includeStuff: false}`) _, string) => string = "doStuff"


let fileContents = doStuff("somefilename.txt")
// Compiles to:
// var fileContents = LibraryX.doStuff({format:"utf8", includeStuff: false}, "somefilename.txt");
@nireno
Copy link

nireno commented Sep 8, 2022

It gets a brief mention under fixed arguments: https://rescript-lang.org/docs/manual/latest/bind-to-js-function#fixed-arguments

@nireno
Copy link

nireno commented Sep 8, 2022

#46 also describes this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants