Davide Giuseppe Farella
03/07/2023, 10:31 PMfun getMovie(movieId: MovieId) = Store(
key = StoreKey<Movie>(movieId),
refresh = Refresh.WithInterval(3.minutes),
fetcher = Fetcher.forError { remoteMovieDataSource.getMovieDetails(movieId) },
reader = Reader.fromSource { localMovieDataSource.findMovieWithDetails(movieId) },
write = localMovieDataSource::insert
)
The full snippet with more info in the thread
The source here: https://github.com/4face-studi0/CineScout/tree/main/cinescout/store/src
I’d like to receive some feedbackDavide Giuseppe Farella
03/07/2023, 10:32 PM