take
fun take(lifecycle: Lifecycle, renderings: Flow<Screen>, repeatOnLifecycle: Lifecycle.State = STARTED, collectionContext: CoroutineContext = EmptyCoroutineContext)
This is the most common way to bootstrap a Workflow driven UI. Collects renderings and calls show with each one.
To configure a root ViewEnvironment, use EnvironmentScreen as your root rendering type, perhaps via withEnvironment or withRegistry.
Parameters
lifecycle
the lifecycle that defines when and how this view should be updated. Typically this comes from ComponentActivity.lifecycle
or Fragment.lifecycle
.
repeatOnLifecycle
the lifecycle state in which renderings should be actively updated. Defaults to STARTED, which is appropriate for Activity and Fragment.
collectionContext
additional CoroutineContext we want for the coroutine that is launched to collect the renderings. This should not override the CoroutineDispatcher but may include some other instrumentation elements.