J
J
JK LD2019-10-14 15:51:11
React
JK LD, 2019-10-14 15:51:11

How can I transfer the state of the store to another project?

if the store has changed in one project, how to transfer it to another?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Suntsev, 2019-10-14
@GreyCrew

This is purely an architectural question.
I see several ways to move the store, it all depends on the requirements of the move.
If everything should work in one browser, then you can save the current store in localstorage (I do not recommend cookies, due to size restrictions) and when loading another project, if they are available in the middleware, immediately pull them up.
If there is a binding to the client, but not to the browser or device, then I advise you to store the data in the database. those. already after authorization, load the past state that the user had. Here it is necessary to think carefully about what data really needs to be stored, as long as storing the entire store can sometimes be redundant. (For example, the user's current progress when filling in some important data, as is done in public services.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question