When we call
recomposer.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