Is there a convenient way to save to sessionStorage without having to manually monitor property changes and updates?
I have a SearchComponent with a property request, for example.
export class SearchComponent { private query: String; private searchResult: SearchResult; ...
Every time a query or searchResult changes (and there are even more properties), I have to manually update sessionStorage.
sessionStorage.setItem('query', query);
Something like an annotation that automatically does the job:
export class SearchComponent { @SessionStored private query: String; @SessionStored private searchResult: SearchResult; ...
I already found a similar solution here . But this session did not work for sessionStorage.
source share