racketscript / racketscript

Racket to JavaScript Compiler
MIT License
713 stars 32 forks source link

How to call javascript function ? #256

Closed acekingke closed 2 years ago

acekingke commented 3 years ago

If I want call a function written by javascript, how to do it in racketscript?

stchang commented 3 years ago

Sorry, somehow I missed this question!

You can do it using the RacketScript JS FFI

See here for some basic examples: https://github.com/racketscript/racketscript/tree/master/tests/ffi

The playground app uses the FFI a lot, e.g., to call out to node libraries: https://github.com/racketscript/racketscript-playground https://github.com/racketscript/racketscript-playground/blob/master/app.rkt

stchang commented 2 years ago

Marking as resolved. Re-open if there is still an issue. Thanks