-
-
Notifications
You must be signed in to change notification settings - Fork 960
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
example for StreamProvider #33
Comments
For firebase you will want to use AutoDisposeStreamProvider, to stop the subscription ASAP when the UI doesn't use the value anymore |
good hint. Wasnt aware of the class alltogether ;-) |
I think it would be super nice to have little code example inside the API doc like with https://pub.dev/documentation/riverpod/latest/riverpod/StateNotifierProvider-class.html. Would speed up adoption drastically. And to me its not clear how to handle the types when constructing the provider as well as with the caller of the hook useProvider(firebaseAuthProvider) |
I strongly agree. I really love your libraries but it takes me some time to figure out how to use them optimally due to lack of examples. Even something simple would go a long way. That said, I plan to share some of the things I come up with. |
I'm finishing #39 first, which will make documenting providers easier. |
Tying together the above comments with the newly introduced syntax:
Thanks for the updates Remi! |
@AlexHartford so AutoDisposeStreamProvider is already outdated and one should use StreamProvider.autoDispose() ? |
The syntax changed a bit recently, yes. |
thanks. Just noticed that i wasnt on latest version. |
I would like to see a more detailed example with StreamProvider in the docs. I think in the flutter / firebase context, a really nice example would be the equivalent of this from the provider way of things:
translated to River Pod, it might look like this, but i could be wrong (since i am trying to clean up here, its not 1:1 translation as is):
Please correct me if i am wrong on this.
The text was updated successfully, but these errors were encountered: