Please tell me, I am working with the ual-anchor library for authorization, as well as with ual-plainjs-renderer for rendering a modal authorization window. My problem is to store an instance of the UALJS class in local storage (or somewhere else) so that I can access this class even after a page reload.
Asked
Active
Viewed 549 times
1
-
I forgot to write that the instance of this class is a circular structure – dsanich Jul 21 '22 at 07:46
2 Answers
1
You are limited to store string key/value pairs in localstorage. The only option is to use JSON.stringify()
and JSON.parse(obj)
checkout this thread:

AG_1380
- 552
- 5
- 12
0
Try using localStorage like this--
localStorage.setItem("class", JSON.stringify(class));
let class = JSON.parse(localStorage.getItem("class"))
localStorage.removeItem("class");

Justin Meskan
- 618
- 1
- 9
- 32