mirror of
https://github.com/JetBrains/intellij-platform-plugin-template.git
synced 2026-01-22 08:39:27 +00:00
Refactor: Rename MyLocationsViewModel to WeatherAppViewModel and update references accordingly
This commit is contained in:
parent
c137351389
commit
9591bc93f3
@ -13,7 +13,7 @@ import org.jetbrains.plugins.template.CoroutineScopeHolder
|
|||||||
import org.jetbrains.plugins.template.ui.ChatAppSample
|
import org.jetbrains.plugins.template.ui.ChatAppSample
|
||||||
import org.jetbrains.plugins.template.weatherApp.model.Location
|
import org.jetbrains.plugins.template.weatherApp.model.Location
|
||||||
import org.jetbrains.plugins.template.weatherApp.services.LocationsProvider
|
import org.jetbrains.plugins.template.weatherApp.services.LocationsProvider
|
||||||
import org.jetbrains.plugins.template.weatherApp.services.MyLocationsViewModel
|
import org.jetbrains.plugins.template.weatherApp.services.WeatherAppViewModel
|
||||||
import org.jetbrains.plugins.template.weatherApp.services.WeatherForecastService
|
import org.jetbrains.plugins.template.weatherApp.services.WeatherForecastService
|
||||||
import org.jetbrains.plugins.template.weatherApp.ui.WeatherAppSample
|
import org.jetbrains.plugins.template.weatherApp.ui.WeatherAppSample
|
||||||
|
|
||||||
@ -26,10 +26,10 @@ class ComposeSamplesToolWindowFactory : ToolWindowFactory, DumbAware {
|
|||||||
val locationProviderApi = remember { service<LocationsProvider>() }
|
val locationProviderApi = remember { service<LocationsProvider>() }
|
||||||
val viewModel = remember {
|
val viewModel = remember {
|
||||||
val weatherForecastServiceApi = WeatherForecastService(Dispatchers.IO)
|
val weatherForecastServiceApi = WeatherForecastService(Dispatchers.IO)
|
||||||
MyLocationsViewModel(
|
WeatherAppViewModel(
|
||||||
listOf(Location("Munich", "Germany")),
|
listOf(Location("Munich", "Germany")),
|
||||||
coroutineScopeHolder
|
coroutineScopeHolder
|
||||||
.createScope(MyLocationsViewModel::class.java.simpleName),
|
.createScope(WeatherAppViewModel::class.java.simpleName),
|
||||||
weatherForecastServiceApi
|
weatherForecastServiceApi
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ interface WeatherViewModelApi {
|
|||||||
* @property viewModelScope The coroutine scope in which this ViewModel operates.
|
* @property viewModelScope The coroutine scope in which this ViewModel operates.
|
||||||
* @property weatherService The service responsible for fetching weather forecasts for given locations.
|
* @property weatherService The service responsible for fetching weather forecasts for given locations.
|
||||||
*/
|
*/
|
||||||
class MyLocationsViewModel(
|
class WeatherAppViewModel(
|
||||||
myInitialLocations: List<Location>,
|
myInitialLocations: List<Location>,
|
||||||
private val viewModelScope: CoroutineScope,
|
private val viewModelScope: CoroutineScope,
|
||||||
private val weatherService: WeatherForecastServiceApi,
|
private val weatherService: WeatherForecastServiceApi,
|
||||||
Loading…
Reference in New Issue
Block a user