Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observability across async gaps? (Will PR if it is reasonable) #856

Open
fzyzcjy opened this issue Sep 4, 2022 · 3 comments
Open

Observability across async gaps? (Will PR if it is reasonable) #856

fzyzcjy opened this issue Sep 4, 2022 · 3 comments

Comments

@fzyzcjy
Copy link
Collaborator

fzyzcjy commented Sep 4, 2022

For example,

@computed // OR use other annotations etc, all acceptable
Future<Something> myFunction() async {
  var a = someObservableValue;
  var b = await fetchSomeNetworkData();
  var c = someOtherObservableValue; // NOTE this line
  return ...;
}

Currently seems that computeds does not notice observable values across async gap.

@pavanpodila
Copy link
Member

Computed like observable is always sync. Async gaps are to be managed with reactions

@pavanpodila
Copy link
Member

Oh and if values like status change async those are observed.

@fzyzcjy
Copy link
Collaborator Author

fzyzcjy commented Sep 4, 2022

I see. Interestingly, Riverpod, another automatic state management lib, supports async: rrousselGit/riverpod#1603 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants