touchlab / KaMPKit

KaMP Kit by Touchlab. A collection of code & tools designed to get your mobile team started quickly w/Kotlin Multiplatform
https://touchlab.co/
Apache License 2.0
2.2k stars 199 forks source link

Use SupervisorJob() instead of regular Job() in MainScope #49

Closed russhwolf closed 4 years ago

russhwolf commented 4 years ago

See https://kotlinlang.org/docs/reference/coroutines/exception-handling.html#supervision for details on how these differ. SupervisorJob is generally useful as a top-level scope for things like ViewModels and similar UI components because a failure of one of its child jobs won't cancel the other children.