-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
implement OptionIntoWasmAbi for Option<&Closure> #2173
Labels
Comments
ctaggart
changed the title
Implement OptionIntoWasmAbi for Option<&Closure>
implement OptionIntoWasmAbi for Option<&Closure>
May 31, 2020
ctaggart
added a commit
to taggartsoftware/ts2rs
that referenced
this issue
May 31, 2020
Steps to reproduce:
|
Seems reasonable to me to add! I think this should be a relatively simple PR to add. |
@alexcrichton can I try my hand at this? |
@teymour-aldridge Of course, we gladly accept PRs. |
Cool! I'll try and do this tommorow. |
This was referenced Jun 20, 2020
Same as #2767 & fixed by #2768. 🥳 Thanks @sinking-point 👏🏻 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
In Monico Editor, you configure the environment with callbacks. This is the TypeScript:
It is not
readonly
, so it is settable. It has a?
, so it may be set with undefined.This works if i map it using an optional js_sys::Function:
In order to have it be more type safe, I want to use Closure:
But then I get this error:
Proposed Solution
Implement
OptionIntoWasmAbi
forOption<&Closure>
.The text was updated successfully, but these errors were encountered: