Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Try to observe changes in local storage#273

Answeredbycyrilletuzi
KRav007 asked this question inQ&A
Discussion options

I subscribe like this to the value in local storage, but if I change the value on a second tab and come back to the main-page, ,there is no console log, that says 'new value'.
I understand the subscribe as an observable and I expect that it listens to the localstorage. Is this right?

this.storage.get('survey_submitted').pipe(
catchError(() => of('survey_submitted')),
).subscribe((result) => {

  console.log('local storage changed');  console.log(result);});
You must be logged in to vote

As stated in the README:

Note you'll only get one value: the Observable is here for asynchrony but is not meant to emit again when the stored data is changed. And it's normal: if app data change, it's the role of your app to keep track of it, not of this lib. See#16 for more context and#4 for an example.

Awatch() method has been added in v9 (see#108).

Replies: 2 comments

Comment options

As stated in the README:

Note you'll only get one value: the Observable is here for asynchrony but is not meant to emit again when the stored data is changed. And it's normal: if app data change, it's the role of your app to keep track of it, not of this lib. See#16 for more context and#4 for an example.

Awatch() method has been added in v9 (see#108).

You must be logged in to vote
0 replies
Answer selected bycyrilletuzi
Comment options

Ok thank you

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@KRav007@cyrilletuzi
Converted from issue

This discussion was converted from issue #273 on December 08, 2020 21:21.


[8]ページ先頭

©2009-2025 Movatter.jp