Install-Module oh-my-posh -Scope CurrentUser -SkipPublisherCheck
Install-Module posh-git -Scope CurrentUser
Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
notepad.exe $PROFILE
Install-Module oh-my-posh -Scope CurrentUser -SkipPublisherCheck
Install-Module posh-git -Scope CurrentUser
Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
notepad.exe $PROFILE
安卓上, 协程可以帮忙解决两大问题:
安卓上使用协程的最好方式是使用官方的架构组件, 它们提供了对协程的支持. 目前 ViewModel, Lifecycle, LiveData , Room 组件提供了对协程一等的支持.
对 ViewModel 的支持主要是在 ViewModel 上提供了一个称为 ViewModelScope 的 CoroutineScope , 所有在 ViewModelScope 上启动的协程, 当 ViewModelScope 销毁时自动取消. 这样可以有效防止忘记取消任务时导致的资源泄漏.