You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks for provider_architecture in reducing the pain of building up a large and maintainable app
After reading couple of issues and blog posts. Registering viewModel as registerLazySingleton rather than registerFactory to avoid multiple requests in API or any data layer.
I want to know how to achieve caching in this architecture?
One way I could think of handling in Services which would give cached data and making background call to update the new data.
But I am interested in your view and how do you approach it. It would be nice if you are able to explain it with a real use case.
The text was updated successfully, but these errors were encountered:
Hi @Amerr I handle all my caching in the services. The viewmodel would only make multiple requests if you're requesting data in the constructor. Which you probably shouldn't. My services handle anything like that. OrderService makes a request, keeps the orders locally or in a db, when requesting it again I first serve from the DB and then go to the API and fetch that.
First of all thanks for
provider_architecture
in reducing the pain of building up a large and maintainable appAfter reading couple of issues and blog posts. Registering viewModel as
registerLazySingleton
rather thanregisterFactory
to avoid multiple requests in API or any data layer.I want to know how to achieve caching in this architecture?
Services
which would give cached data and making background call to update the new data.But I am interested in your view and how do you approach it. It would be nice if you are able to explain it with a real use case.
The text was updated successfully, but these errors were encountered: