Skip to content
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

Document "@as(jsonxxx)" #550

Open
cristianoc opened this issue Sep 7, 2022 · 2 comments
Open

Document "@as(jsonxxx)" #550

cristianoc opened this issue Sep 7, 2022 · 2 comments
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

@fhammerschmidt fhammerschmidt modified the milestones: v10.0, v11.0 Jan 17, 2024
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

No branches or pull requests

3 participants