Hello! I was wondering how I can get a Context/App...
# decompose
m
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
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/