theapache64
10/24/2021, 6:55 PM::exitApplication
? System.exit(0)
or something special? Just curious 😬CLOVIS
10/24/2021, 8:10 PMtheapache64
10/24/2021, 8:16 PMApplicationScope
and found this 😄
if am not wrong, it simply update a boolean state to false, and when recomposed, we’re not rendering the content
. If we’re not rendering anything, the recomposer
will end the app ? I don’t get that part actually 🤔Kirill Grouchnikov
10/24/2021, 8:59 PMIgor Demin
10/24/2021, 9:03 PMrecomposer.close()
we actually don't close or cancel anything. We just tell Recomposer, that when it has no active coroutines (usually launched via LaunchedEffect
), it should shutdown itself, and no longer do any recompositions. When it will shutdown, join
will unblock the main coroutine.
If we use Window
, it:
1. creates its own LaunchedEffect
to keep Recomposer
alive.
2. creates a native window on composition init, disposes the native window on composition dispose
When we call exitApplication
(i.e. set isOpen = false
) we dispose all compositions, and so cancel all `LaunchedEffect`'s, and dispose all native windows, opened inside application
theapache64
10/24/2021, 9:05 PMclose
doesn’t suite here, isn’t it ? or I don’t knw 😄 maybe closeWhenNothingToCompose()
😄 and this method should be a suspend
method (so we can remove join
from there) and that make becomes more readable i guess… just a wild thought 😬Igor Demin
10/24/2021, 9:21 PMKirill Grouchnikov
10/25/2021, 4:26 AMapplication
implementation details