0

We are developing a react/typescript/redux app and have the problem, that we want to work on a component, which is only visible under certain conditions. So the workflow is: Change code, compile it (fast), then reload the app in browser and then click through the app, until the condition for the visibility is met.

To speed this "click-through" up, we thought about initialising the app with some saved state instead of clicking through the app.

We know of course, that the redux-developer-tools enable to export/import a redux-state, and we had also other ideas, but we asked us, if there are better/faster/simpler methods to set the state.

Cause this feature is only needed during development: Some simple to use - eventually "dirty" - methods of loading a saved state after the bootstrap? What do you think about using redux-storage, especially https://www.npmjs.com/package/redux-storage-engine-jsurl?

ssilk
  • 21
  • 2
  • I am assuming you need to initialize the state - This [link](https://stackoverflow.com/questions/37823132/how-to-set-initial-state-in-redux) might help you – tarzen chugh Apr 25 '19 at 16:56
  • Of course we do that. :) What we are looking for is a switch between initialialising for the "normal" case and the case, when we need to develop/test new components. In that case we need to switch back and forth between several states. Example: A component is displayed only when in another component a button was pressed, a text field was filled and in a third component some item is choosen. Which is some of the easier cases. To simplify the development we want to set the state to the moment, when all preconditions are set. But only during development, of course. – ssilk Apr 26 '19 at 09:23

0 Answers0