Shallow equal for arguments #2039
Unanswered
standbyoneself
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
Is there a way to shallow equal object arguments?
Example that request body is coming from
useReducer
.Also I have a form when I need to revalidate on:
I dispatch form value on these actions and pass it as a request body in useSWR arguments.
There is a main problem: if you change the form value by dispatch, revalidate will come, but as SWR deeply compares arguments passed as objects it wouldn't make revalidate if the request body wouldn't change.
Also it seems to me using the mutate() on these 3 actions wouldn't be so declarative, so any workarounds on this?
Feature request? Because similar option
compare
already exists for dataBeta Was this translation helpful? Give feedback.
All reactions