Closed rrousselGit closed 1 year ago
Personally I'd like to see Initializing providers inside the main
higher in the list, since it is very common, especially with SharedPreferences / Firebase.
I moved it a bit. It should be fine now I think
Edit: I've changed my stance on this. I'll likely promote a different approach instead.
I'd like to see some more details on ref.refresh and ref.invalidate with some use cases. I only found these in the API documents and invalidate solved a problem I had with refreshing a pane containing a watch in a desktop app. However not 100% sure I'm using it correctly.
Can you clarify something that's really bugging me? I understand why you should never modify another provider from a provider's build method as is specified in "Good practices" point 2. However, does this also apply to the build method of a FutureProvider? For example, say I have a FutureProvider that gets some data for a widget, would it be bad to have this FutureProvider update other providers with that data after it gets it asynchronously (so a certain amount of time after the build method was called). I understand that this doesn't technically cause an error as of now, but I don't want to build my code around this practice and then be unable to update my Riverpod package version because that functionality was patched as a bug. I am trying to do it like this for a complex reason, and I will explain it if anyone wants to know why, but I thought it would be best to just ask about the problem in a general sense first.
However, does this also apply to the build method of a FutureProvider?
Yes
You shouldn't modify providers inside future/StreamProvider's initialization method, even after an await
@rrousselGit Thanks for the response. I just opened up a discussion thread with my follow up question so that I don't pollute this thread. https://github.com/rrousselGit/riverpod/discussions/2388
Now that StreamProvider<>().stream is being deprecated, I'm having trouble figuring out how to refactor my code. The issue is that I'm building a library without any UI ... instead, I'm using streams like an event-bus. One provider creates a new (mapped or filtered) stream based on ref.watch() another streamProvider.
So I'm unclear how to convert from syntax like:
await for (final NcCommandEvent cmdEvt in newBStream) { if (cmdEvt.isErrorEvent) { yield cmdEvt; } }
to the new AsyncValue.when() syntax
how do I map-across to a new stream within the dependent provider??
@rrousselGit, I created 2 issues related to existing documentation. One of them is simply covering an additional case within the testing docs, but I'm including a code snippet, so I thought it would be better organized within its own issue. If you'd prefer me to put both of those issues in here as comments instead, just let me know!
Hi. Is there any update? 😔
I can't suggest this package to anyone, because I can't show them a valid documentation. Documentation for Riverpod 1.0 was very good. But I should not tell to use one year old version (1.0.3)
Docs-v2 has been merge to master.
Docs are up-to-date with many additions and more to come. They should be in a good place right now. So closing this in favour of the other issues tracking docs changes
Yesterday I read all the documentation. Congratulations. The text is very readable and comprehensive.
This is a meta issue about what's planned for the new documentation. The following list represents the sidebar of the new docs
The order in which these items are placed on the list is important. They are supposed to be in order of difficulty and how common the topic they cover is.
To anyone reading: If you see anything possibly missing from this list, please make a comment. This list is by no means final and it's open to suggestions
Also, if a topic is on the list, but you think it's important for the article to cover one case, please say so! (cf "testing" with its sub-list)
Associated more specific issues: