Well this pattern works well for a simple object like yours. If it's a deeply nested object and for any reason you need to keep the integrity of the object, reducer composition is something that would add lots of value to you.
I'm a web developer and consultant, web GDE, and author of open source libraries. I co-founded 500Tech, a company that specializes in frontend technologies. I love coding, and love speaking about code
Can you give an example?
If I understand you correctly, then you can also compose the setter function of useState and add functionality on top like data integrity.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Well this pattern works well for a simple object like yours. If it's a deeply nested object and for any reason you need to keep the integrity of the object, reducer composition is something that would add lots of value to you.
Can you give an example?
If I understand you correctly, then you can also compose the setter function of useState and add functionality on top like data integrity.