This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
How to retrieve oldValue as an object from onSet effect? #1320
Unanswered
stefanstaynimble
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using
effects_UNSTABLE
on my atom to make PATCH requests to my API with updates made the atom. The response time of the API call is dependent on the payload sent to the server.In order to reduce the payload, I want to be able to get the difference from the new value and old value using the
onSet
function. Problem is,oldValue
returns aDefaultValue
instance, so I cannot determine the differences from the original atom state and the new state.Example:
Any ideas how I can achieve this?
Beta Was this translation helpful? Give feedback.
All reactions