Closed Kingdutch closed 2 years ago
I found at least one example where a non-optional parameter comes before an optional named parameter. This results in making the optional named parameter non-optional or requiring another unit argument.
https://github.com/zth/rescript-relay-router/blob/5b540248e2a29ebeb57fcfc6f6b2ddb39a1e6535/cli/RescriptRelayRouterCli__Codegen.res#L590
I would propose to change this to
let isRouteActive = (~exact: bool=false, {pathname}: RelayRouter.Bindings.History.location): bool => {
This enables the following to work without errors:
Route.isRouteActive(location) Route.isRouteActive(~exact=false, location) location->Route.isRouteActive location->Route.isRouteActive(~exact=false)
We can use this issue to find other places where ergonomics can be improved.
Yes, this sounds great, good catch!
I found at least one example where a non-optional parameter comes before an optional named parameter. This results in making the optional named parameter non-optional or requiring another unit argument.
https://github.com/zth/rescript-relay-router/blob/5b540248e2a29ebeb57fcfc6f6b2ddb39a1e6535/cli/RescriptRelayRouterCli__Codegen.res#L590
I would propose to change this to
This enables the following to work without errors:
We can use this issue to find other places where ergonomics can be improved.