package Ġcom . j vent rib . form ul ain fo . ui . schedule Ċ Ċ import Ġandroidx . lifecycle .* Ċ import Ġcom . dropbox . android . external . store 4 . Store Response Ċ import Ġcom . j vent rib . form ul ain fo . data . Race Repository Ċ import Ġcom . j vent rib . form ul ain fo . model . db . Race Ċ import Ġdagger . h ilt . android . lifecycle . H ilt ViewModel Ċ import Ġjavax . inject . Inject Ċ Ċ @ H ilt ViewModel Ċ class ĠSe ason ViewModel Ġ@ Inject Ġconstructor ( private Ġval Ġrepository : ĠRace Repository ) Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġval Ġseason List Ġ= Ġ( 1 9 5 0 .. 2 0 2 1 ). toList (). reversed () ĊĊĠĠĠ Ġval Ġseason Ġ= ĠMutable LiveData ( 2 0 2 1 ) ĊĊĠĠĠ Ġval Ġround : ĠMutable LiveData < Int ?> Ġ= ĠMutable LiveData ( null ) ĊĊĠĠĠ Ġval Ġr aces : ĠLive Data < Store Response < List < Race >>> Ġ= ĊĠĠĠĠĠĠĠ Ġseason . distinct Until Changed (). switch Map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrepository . getR aces ( it ). as LiveData () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġrefresh () Ġ{ ĊĠĠĠĠĠĠĠ Ġrepository . refresh () ĊĠĠĠ Ġ} Ċ } Ċ