-
Notifications
You must be signed in to change notification settings - Fork 40
Use more option types in the bindings? #21
Copy link
Copy link
Open
Description
Is there any reason why functions which can return null in JS (e.g. document.querySelector) are not typed as returning option values? With the current types it's trivial to get runtime errors which I wouldn't expect from a statically typed language that compiles to JS. In TypeScript that function returns Element | null which means the user cannot call methods on it without checking that it's not null. In OCaml (BuckleScript) it returns Dom.element option. I would expect the same in F#.
cc @nojaf who suggested I open an issue here
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels