Life-cycle of providers #1029
-
|
Hello there! I noticed that even though we define providers and their dependencies globally, they are not created/initialized/constructed until they are either To me providers represent the backend logic for UI. For example in some of my provider constructors, in my chat app, I kick-off async What do you think about this? Am I using (riverpod) providers completely wrong or is this a valid concern? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Reading the providers that you want to eagerly initialize in the top-most components is the correct solution Due to how Dart works, there's currently no way to do otherwise. Maybe that'll change with metaprogramming, but for now that'll be your only solution |
Beta Was this translation helpful? Give feedback.
Reading the providers that you want to eagerly initialize in the top-most components is the correct solution
Due to how Dart works, there's currently no way to do otherwise. Maybe that'll change with metaprogramming, but for now that'll be your only solution