Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 25, 2022 11:18 pm GMT

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

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To