An Interest In:
Web News this Week
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
Restoring 'Default/Initial' values from Redux Store
Hi im new to react and redux.
I have a web application using redux.
through out the usage of the react redux web app, the state changes. However, i have default values already inputted into my reducers state.
Does react/redux offer a way to restore those initial state values? Or would i have to find a way to duplicate the initial state and create a variable somewhere, in order to access my default values?
I wish to create a 'reset' buttons where the button will filter through my deeply nested array of objects that i have in my reducers state, and change the values back to my initial/default values.
Does any know if there is an easy way to do this?
I was thinking of creating another reducer and storing the default values where i would only read/get the values from there?
any help or guidance would be greatly appreciated
Original Link: https://dev.to/jr_web_dev/restoring-defaultinitial-values-from-redux-store-3ie9
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To