https://kotlinlang.org logo
#compose
Title
# compose
v

Vinay Gaba

10/15/2020, 3:49 PM
So in the latest release,
launchInComposition
got renamed to
LaunchedTask
. Eerily close to
AsyncTask
in name and functionally (not entirely true) 😆
z

Zach Klippenstein (he/him) [MOD]

10/15/2020, 3:57 PM
Copy code
@Composable fun <T> AsyncTask(block: suspend CoroutineScope.() -> T): Deferred<T> {
  val scope = rememberCoroutineScope()
  return remember { scope.async(block) }
}
🧌
🧌 14
a

Adam Powell

10/15/2020, 4:18 PM
I think you just wrote
produceState
but without the observable result 😄
☝️ 1
but yes, the similarity to AsyncTask is both understood and partially intentional - it may go through one more rename before we're done though since we seem to be converging on some other names for the effect APIs like
SideEffect
and
DisposableEffect
, and then it might make more sense for this to be
LaunchedEffect
the fun of alpha api churn 🙂
z

Zach Klippenstein (he/him) [MOD]

10/15/2020, 5:03 PM
ApiEffect
s

Se7eN

10/15/2020, 5:19 PM
EffectEffect
🎉 1
😂 1
a

Adam Powell

10/15/2020, 10:42 PM
There's something nice about being able to precisely refer to the family of functions