0

What i'm trying to do

I want to go through one array, create another array that represents mapping by index, save it in Local Storage, and then when the app first mounts to check if there is a value stored in Local storage, and if so then sort the array of data coming from the store (as Proxy) So that they are displayed according to the mapping in LocalStorage.

Hope the explanation is clear :)

I got the data from store as a Proxy like so:

const chocolates = machineStore?.SubsystemsInfo

when i console it out, i need to stringify and parse it so i can view it in the console. it look like so:

enter image description here

When the component mounts, i get the array of mapped indexes from LocalStorage, but the problem now is that i need to render the original array based on it and i cant because it's a Proxy and i cant get access to the array itself, so i can then sort.

enter image description here

how can i convert the data to a regular array so i can work with it ?

i already tried spreading, and parsing so it brings am empty array.

any ideas what do i miss?

Thanx

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.