-1

I want to persist in the state of the redux store but do not want to handle it using the local storage. I just read some documents but according to the answers they provide, we can persist the state of the redux store using two methods:

  1. Using the redux-storage but it is now deprecated.
  2. Using the local storage.

I just tried the local storage. But, I think it will affect my app's performance at some point.

2
  • 1
    Using localStorage should be fine. If your platform supports it use it. If you need more secure storage there are options for that. Are you seeing any actual performance issue right now? Commented Jul 1, 2024 at 16:51
  • 1
    Firstly, as @DrewReese said, how do you know it will affect your app's performance? Did you profile it? Secondly, you can use any storage engine implements the interface. Commented Jul 2, 2024 at 2:21

2 Answers 2

0

In my opinion you can use redux-persist which is a library to allows you to save the Redux store in various storage engines, not just local storage. It supports IndexedDB, session storage, and even custom storage engines, so that could be used in your case.

You can find more details and usage example on the given link.

https://www.npmjs.com/package/redux-persist

Sign up to request clarification or add additional context in comments.

Comments

0

I hope you need to persist the data on your application, without using local storage ( cause of reducing performance ).

You can use Indexed DB storage.It's more faster than local storage. Read this documents for basic understanding of IndexedDB indexedDB

After the understanding of indexDB, you can create your own custome hook for clean code.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.