Utilizing associative arrays with redux and storing them in async storage for later retrieval is my current challenge. When using redux, I am able to quickly access the values and efficiently map the content into cards in my react native app.
However, after storing the data in async storage, I encounter an issue where I have to JSON.stringify the content and then JSON.parse it upon loading. Unfortunately, I am unable to use the object in the same manner as before.
The structure of my data is as follows:
[ '1442-3338': { ID: '1442-3338', something: 'something', Participants: [] }, '1442-3339': { ID: '1442-3339', someting: 'something', secondArray: {} }, '1442-3340': { ID: '1442-3340', something: 'something', secondArray: {} }, '1442-3341': { ID: '1442-3341', something: 'something', secondArray: {} } ]
Initially, I can access the data using object['1442-3338']
. However, after storing and retrieving the data with JSON.stringify and JSON.parse, I encounter difficulties reading the data as the keys are no longer recognized.