Comments (7)
There aren't many reasons.
I just found the code more readable when reading providers, but that's about it.
from riverpod.
Ah, this is referring to "if you used read
instead of watch
to filter rebuilds, don't do that and instead see [link]"
Is that a better wording?
from riverpod.
Done 😄
from riverpod.
Thanks for getting back with me. The docs do seem to suggest that this causes unwanted rebuilds.
It may cause less confusion to highlight passing a reference as the idiomatic way to go about instantiation rather than labeling all calls to read inside a provider as a bad practice.
from riverpod.
The docs do seem to suggest that this causes unwanted rebuilds.
What are you referring to? Because it doesn't
from riverpod.
DON'T call [read] inside the body of a provider
If you want to avoid unwanted rebuilds of your object, see My provider updates too often, what can I do?
That is at least how I interpret the above, sorry if I am missing something.
from riverpod.
OK I understand and yes that is much more clear. Just a nit but I think that concept would be much more clear either in it's own info message box or perhaps above the code block in that section. Happy to make a pr if that'd help
from riverpod.
Related Issues (20)
- ImageProvider generated as InvalidType HOT 4
- `AutoDisposeProvider` is getting disposed when watched in a `StreamProvider` using `async*` HOT 1
- Provider container loses data in widget test HOT 4
- AutoDisposeNotifierProvider causing state loss HOT 3
- Reword `The ref.watch method should not be called asynchronously`
- Add a DevTools extension for riverpod HOT 2
- Broken update HOT 3
- [riverpod 3] NotifierProvider doesn't work with a NotifierBase mixin.
- riverpod_generator does not respect import aliases HOT 1
- Ref onError callback HOT 1
- `ref.exists()` returns `true` when manually invalidate a provider.
- `yarn dev -l {LANG}` is needed when hosting documentation website locally for specific locale with docusaurus
- Stream from StreamProvider is not unsubscribed to when widgets get disposed
- There is no way to handle the "done" event on the stream of a StreamProvider
- `ref.invalidate(familyProvider)` is not working with scoped providers
- PageController stateprovider doesn't work when .previousPage() or nextPage() is pressed HOT 1
- beforeDispose or beforeInvalidate hook, happen before invalidate HOT 6
- Multiple invalidation of Providers HOT 2
- Unable to use the latest riverpod in flutter version lower than 3.16 HOT 2
- The getter 'variable2' isn't defined for the class 'PropertyAccessorElement'. HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riverpod.