package Ġcom . sample . music x . data Ċ Ċ import Ġcom . sample . music x . model . Artist Ċ import Ġkotlinx . coroutines . Dispatch ers . IO Ċ import Ġkotlinx . coroutines . with Context Ċ Ċ class ĠArtist Repository Ġprivate Ġconstructor ( private Ġval Ġartist Dao : ĠArtist Dao ) Ġ{ ĊĊĠĠĠ Ġfun Ġget Art ists () Ġ= Ġartist Dao . get Art ists () ĊĊĠĠĠ Ġsuspend Ġfun Ġinsert All ( artists : ĠList < Artist >) Ġ{ ĊĠĠĠĠĠĠĠ Ġwith Context ( IO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġartist Dao . insert All ( artists ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġinstance : ĠArtist Repository ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġfun ĠgetInstance ( artist Dao : ĠArtist Dao ) Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinstance Ġ?: ĠArtist Repository ( artist Dao ). also Ġ{ Ġinstance Ġ= Ġit Ġ} ĊĠĠĠ Ġ} Ċ } Ċ