You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getUser produce only one value null when I add new user to via setUser method to local storage in the AppComponent subscribe doesn’t produce value but when I subscribe directly to _localStorage.getItem()
it works.
I use Angular 5 and Typescript 2.4.2.
The text was updated successfully, but these errors were encountered:
If I understand your problem correctly, you would like getItem to send a new value each time local storage is updated. Is that so ?
If so, it's not how this lib works. getItem just return one value, when it is requested. And that is normal : local storage won't change by itself, it is your app which will change it. So if you want to track changes, it's the role of your app to do so. And it's not the local storage itself you should watch, it's just the value in your app.
Hello I wrap AsyncLocalStorage into another service.
Inject service in the component and subscribe to method getUser which use getItem method..
export class AppComponent implements OnInit{
}
getUser produce only one value null when I add new user to via setUser method to local storage in the AppComponent subscribe doesn’t produce value but when I subscribe directly to _localStorage.getItem()
it works.
I use Angular 5 and Typescript 2.4.2.
The text was updated successfully, but these errors were encountered: