snapsl
snapsl
I would recommend to adapt a programming pattern like the repository pattern. The repository implements your business logic including caching, pagination, filtering, etc... . Then you can build your state...
Let's stay with the todo example and create a small sample todo repo to make this more clear. ```dart class TodoRepo { TodoRepo(LocalSource, RemoteSource, ...); List getTodoList()...; Todo getTodo(String id)...;...
@rrousselGit creating a riverpod pattern 👍
Okay, I am not sure if it helps to stay with the todo example. But this is still the same principal. 1. Add these functions to the repository. ```dart class...
> As mentioned in the original issue, lets still assume we are working on a web application where the user might directly navigate to https://my-awesome-todo.app/todos/:id. There is no way that...
That is great progress! 👍 Thank you @rrousselGit for keeping us up to date. --- What about the mutation syntax introduced in #1660? The return value of the mutation would...
Each view would have its own state that needs to be updated. E.g. ```dart // home view @reactive Future home() => /* http.get(...) */; // recent view @reactive Future recent()...
> Exposing the state of all providers like that is fairly problematic as it's not reactive. Can you elaborate this. Dependant states could use `ref.watch` during init. ```dart @riverpod class...
> I see no relation between this snippet and the fact that mutations return T instead of void. Could you clarify? > When you call addUser(user), you're not calling the...
> No. The wrapper _will_ rethrow any error thrown by your mutation. > > Don't throw in your mutations if you don't want Riverpod to rethrow errors :) I have...