Open Amerr opened 4 years ago
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.