I'm not sure if it's a bug for sure, but this one is definitely not a feature, this is why I went for the 'Bug report' :)
Versions (please complete the following information):
NgxWebstorage: [3.0.2]
Angular: [7.2.0]
Describe the bug
My concern is that when I try to store functions to either localStorage or sessionStorage after the page refresh (F5), the functions are gone, however, properties are still persisted
To Reproduce
Steps to reproduce the behavior:
Before the page refresh:
this.foo = (a) => {console.log(a)}
(a) => {console.log(a)}
Hi,
I'm not sure if it's a bug for sure, but this one is definitely not a feature, this is why I went for the 'Bug report' :)
Versions (please complete the following information):
Describe the bug My concern is that when I try to store functions to either localStorage or sessionStorage after the page refresh (F5), the functions are gone, however, properties are still persisted
To Reproduce Steps to reproduce the behavior: Before the page refresh: this.foo = (a) => {console.log(a)} (a) => {console.log(a)}
this.localStorageService.store('obj', {'foo': this.foo, 'property': 'propertyValue'}); {foo: ƒ, property: "propertyValue"}
this.localStorageService.retrieve('obj').property "propertyValue"
this.localStorageService.retrieve('obj').foo (a) => {console.log(a)}
After the page refresh: this.localStorageService.retrieve('obj').foo undefined
this.localStorageService.retrieve('obj').property "propertyValue"
Expected behavior I would expect that saved function would be still in a storage
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Cheers, Dani