Closed andrehsu closed 3 years ago
hi @andrehsu, sounds like a nice idea 👍 In PR, at the moment, I would not remove the invariant.
Hi @andrehsu, today (soon) release version 4.0.0-rc.4 with your PR, I would like to have your feedback as over the weekend I intend to officially release version 4.0.0 👍
Currently, if you call type, the
useMutate
with no variables argument, and use the resulting function without specifyingvariables
, you can a runtime error. By using method overloading and by having a separate MutateWithVariablesinvariant
check can be enforced at compile-time.Also, since the
...config
spread is the last argument, thevariables
inuserConfig
is always going to override thevariables
specified inmutate(config)
I can submit a PR if this is a good idea.