Closed spocke closed 2 years ago
We probably only need one named argument, not two, for example replaceChild
only needs to name old
. This will cut down on the number of names we need to decide on 😂
Right yeah. I was probably thinking about the array bindings where you have both start and end named arguments. But it would be a lot of verbosity to have both. I updated the ticket example.
Thinking about Node.contains
, while the first argument (parent/current) would be the ideal place to put the label it would break using the pipe operator. So the T.t
argument can never be named.
Given our own struggles in converting a codebase from bs-webapi
to rescript-webapi
I'm moving this to the 1.0 release.
I realised I was wrong about only needing one name for replaceChild
. Without naming new
the t
could be passed as the second argument instead of the first without a compile error.
Released as 0.5.0
There are situations where it very hard to tell what order the arguments should be for example:
Node.replaceChild(T.t, Dom.node_like<'a>, Dom.node_like<'b>)
It would be better if it was something like:
Node.replaceChild(T.t, Dom.node_like<'a>, ~old=Dom.node_like<'b>)