Join Slack
Powered by
Hello! I was wondering how I can get a Context/App...
# decompose
m
Mark Yavorskiy
05/27/2023, 12:11 PM
Hello! I was wondering how I can get a Context/ApplicationContext and scope for coroutines (like viewModelScope) in a component? Are these things available out-of-the-box or do I need to pass them through the constructor?
a
Arkadii Ivanov
05/27/2023, 12:19 PM
It's not available out of the box. You can pass a context via constructor, or you can define custom ComponentContext (
https://arkivanov.github.io/Decompose/component/custom-component-context/
). I recommend using constructors for this, but it's up to you. For scopes, check out this doc -
https://arkivanov.github.io/Decompose/component/scopes/
5
Views
Open in Slack
Previous
Next