Is it possible to set the state from my store to its original "form"?
In my application I have modal and when it's closed I want to get rid of all the changes that the user has made.
This is my state:
const state = {
calendarOptions: [
{ startDate: moment().format("YYYY-MM-DD"), endDate: moment().add(365, 'days').format("YYYY-MM-DD")}
],
startDate: moment().format("YYYY-MM-DD"),
endDate: moment().add(7, 'days').format("YYYY-MM-DD"),
dirtyRangeUpdate: true,
availableChannels: {},
availableRooms: {},
availableRates: {},
weekDays: [],
rangeContext: '',
selectedRooms: [],
selectedRatePlans: [],
selectedChannel: [],
revenueRatePreference: '',
showOnlyPreselected: true,
rangeUpdateDataCollection: null,
rangeUpdateSubmitData: null
}
How is it possible to achieve it? Thanks in advance.