-
Notifications
You must be signed in to change notification settings - Fork 81
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
JavaScript Ergonomics #300
Comments
I don't quite follow. The problem with nested Which values would you use for |
I can see that the ability to use a switch over a variant would be desirable. But can you elaborate why this code is "unsafe and problematic" in TypeScript? How would you suggest to represent argumentless variants like |
|
I would represent argument-less variants as strings of the variant name. This handles mixed variants well enough, and allows for strong type inspection into
|
After discussing with @chenyan-dfinity , we agreed that nested opts should be typed the same as they are now, with nested empty arrays |
* Be less specific about authentication methods * Keep attestation option
Currently, there are two issues with the JavaScript / TypeScript bindings that make development inconvenient for IC developers.
[]
does not align with expectations of developers, as Arrays are used to represent ordered data.{ ok : () } | { err: string }
cannot be safely accessed asresult.ok
orresult.err
, but requires the user to write something likeDescribe the solution you'd like
The text was updated successfully, but these errors were encountered: