equal
deleted
inserted
replaced
38 |
38 |
39 private val licensesInfo = flow { |
39 private val licensesInfo = flow { |
40 emit(licenseInfoRepository.getLicensesInfo()) |
40 emit(licenseInfoRepository.getLicensesInfo()) |
41 }.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), emptyMap()) |
41 }.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), emptyMap()) |
42 |
42 |
|
43 /** |
|
44 * List of dependencies |
|
45 */ |
43 val dependenciesList = licensesInfo.map { licensesInfo -> |
46 val dependenciesList = licensesInfo.map { licensesInfo -> |
44 licensesInfo.keys.sortedBy { it.lowercase() } |
47 licensesInfo.keys.sortedBy { it.lowercase() } |
45 } |
48 } |
46 |
49 |
|
50 /** |
|
51 * Obtain the license for [dependency] |
|
52 */ |
47 fun getLicenseDependency(dependency: String) = flow { |
53 fun getLicenseDependency(dependency: String) = flow { |
48 emit(licenseInfoRepository.getLicenseFor(dependency)) |
54 emit(licenseInfoRepository.getLicenseFor(dependency)) |
49 } |
55 } |
50 |
56 |
51 companion object |
57 companion object |