rrousselGit / riverpod

A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
https://riverpod.dev
MIT License
5.82k stars 888 forks source link

Add dependency injection doc #3501

Open snapsl opened 2 weeks ago

snapsl commented 2 weeks ago

Make riverpod onboarding easier.

A great feature of riverpod is that we can easily implement dependency injection. But this is not described in the documentation.

The documentation should contain:

How-To implement dependency injection using riverpod:

If needed, I can contribute to the docs.

rrousselGit commented 2 weeks ago

Can you be more specific about what you want here? Riverpod is not a DI package. And there are already docs explaining how to define a provider, override it, and test it.

snapsl commented 2 weeks ago

Of course, using riverpod for DI is just a part of it link. And eventually we use the same concepts (provider, override, testing) that are already defined in the documentation.

I thought about creating an exemplary use case maybe a "case study" that shows how to implement it. Dependency injection is such a frequently applied pattern. Why not promote how easy it is to implement using riverpod?