Storing a class in local storage?

Viewed 34

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.

2 Answers

Try using localStorage like this--

localStorage.setItem("class", JSON.stringify(class));
let class = JSON.parse(localStorage.getItem("class"))
localStorage.removeItem("class");
Related