I have some server actions that are the same in each subpage. Noticed that in some of the subpages it takes a liitle more to load this data again, since there are other things loading. Should I use ‘local storage’ for these elements that load on every subpage each time?
Yes you can do that perfectly. Use the State Manager to store the full data in local Storage or Sessions Storage and they just bind and use it from there
Well when you save new data you have to take care that your cache is refreshed. The local storage has no idea that your data has being changed. So just on save of the updated that re-query your data and store it again in the local storage.
When using State manager/local with a server connect do i bind elements to the Local storage or the server connect? Because the Local Storage thing only has ‘data’ and not the fields i need.
Do i bind normally to the server connect? and it just caches automatically?
Thanks. it was when he said " and they just bind and use it from there" that i wasn’t sure if he meant from the serverconnect or from the localstorage.
Hello @George,
I’m making an API call which fetch an object including multiple field like text, numbers, arrays etc. On API call I’m storing that json object in a local storage object. Is there a way to access only specific field of that object i-e if the object in local storage is named student which contains response of API including multiple fields student name, age, roll no, reg no, DOB etc. Now how can I access each field separately for displaying it on page. I have tried these: {{local1.data.student.name}} and {{local1.data.student[“name”]}} but both doesn’t worked.
Will I have to make multiple field in local storage under student object or can I access all the fields without explicitly defining each field. Any suggestions for this?