Keeping copies of original object #2731
Unanswered
alex-dow
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an object I wish to edit, and the UI for doing so is split across many different components.
I wanted to simplify my life, so I created a store that all these components will use. I wanted to have both a mutable and immutable ref to the object being edited (eg, I don't want edited values in form elements to be used when displaying those values elsewhere on the screen until the user saves). So I did this:
I want it this way, because the various form components that are used to edit
myObject
depend on having access to all values for validation purposes.So I'd like to know if this is a sensible approach or if there is a better approach I can take.
thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions