This is fully backward compatible for body of type string/number. So, this PR adds supports for body as FormData or Object which is useful for some cases.
Nice, that it's already like this in Mutate component. Only the hook has missed this point.
p.s somehow we need to avoid duplicating code/tests in the component and hook (If you have the same feeling, let me know, I will open a new issue to discuss in more details). Probably, I don't fully understand the idea of having two sources of truth (Component and Hook) instead of one (Hook).
So, my idea is to use hook in the component directly. So, all logic will be in one place (Hook).
Just an example:
Why
Resolves #288
This is fully backward compatible for body of type string/number. So, this PR adds supports for body as
FormData
orObject
which is useful for some cases.Nice, that it's already like this in Mutate component. Only the hook has missed this point.
p.s somehow we need to avoid duplicating code/tests in the component and hook (If you have the same feeling, let me know, I will open a new issue to discuss in more details). Probably, I don't fully understand the idea of having two sources of truth (Component and Hook) instead of one (Hook).
So, my idea is to use hook in the component directly. So, all logic will be in one place (Hook). Just an example:
thoughts? 🤔