khushpanchal / Ketch

An Android File downloader library based on WorkManager with pause and resume support.
https://medium.com/@khush.panchal123/ketch-android-file-downloader-library-7369f7b93bd1
395 stars 26 forks source link

Support compose #1

Closed fjr619 closed 4 months ago

fjr619 commented 4 months ago

Please make it to support jetpack compose

khushpanchal commented 4 months ago

Please make it to support jetpack compose

@fjr619 You can use it with compose as well. There is no limitation. Just create the instance, call the download function and pass the url. You can create the instance in Viewmodel as well if you want to retain the instance while configuration changes.

PrimoDev23 commented 4 months ago

While it might be possible to have this logic in the ViewModel, you should rather create an abstraction in your domain layer and inject it into your ViewModel. This is much more best practice. Doesn't change the fact it works the same way for Compose 😄

khushpanchal commented 4 months ago

True @PrimoDev23 🙌

khushpanchal commented 4 months ago

Closing the issue