riverpod
riverpod copied to clipboard
Update the assert which catches missing `dependencies` to support ref.read/ref.invalidate/... links
If a provider depends on another provider using methods such as ref.read/ref.invalidate & co, then the assert responsible for detecting missing providers in dependencies: [...]
is unable to throw.
This happens because methods such as ref.read & such do not update the internal list of "what the provider is depending on".
That is deliberate because we want to avoid memory leaks. But one solution could be to create such an internal list, and only store Family
instead of the provider itself when depending on a family. This would avoid keeping the arguments in memory.