createHistoryCache and makeHydratable(reducer) are hacks to make a proof of concept work. It should be up to the individual reducer to decide if it needs to reset itself on history changes. Perhaps a higher order reducer function that accepts reducers and gives them state based current the current history key.
state = {
history: {},
historySession: {
xwu39s: {
filter: {
// Some filter state specific to the xwu39s history.
}
}
}
}
There would also need to be some selector functions to make it easy to select the state for current history session but that's easy enough. I like this direction much more...
createHistoryCacheandmakeHydratable(reducer)are hacks to make a proof of concept work. It should be up to the individual reducer to decide if it needs to reset itself on history changes. Perhaps a higher order reducer function that accepts reducers and gives them state based current the current history key.There would also need to be some selector functions to make it easy to select the state for current history session but that's easy enough. I like this direction much more...