purescript-contrib / purescript-react-dom

Low-level React DOM bindings for PureScript
MIT License
16 stars 16 forks source link

`refToNode` doesn't need to take a Nullable value #9

Closed natefaubion closed 6 years ago

natefaubion commented 7 years ago

I don't see why refToNode needs to take a Nullable. The corresponding purescript-react API returns a Maybe Ref, so it has to be converted to Nullable, and then back to Maybe just to use this API. Since it's just a coercion, why not just export an unsafe coercion? I think it's probably better to do it safely through purescript-dom's Foreign based readers, though.