I have a question with using SQLDelight in a Compose desktop app. Right now, my main function instantiates ApplicationState -> WindowState -> etc.
Where do you usually instantiate the Database object and add initial content to it? And do you do that in a Repository singleton with Kotlin flows?
Just wondering if there's some sample app that people can share. Thanks!
m
mohamed rejeb
03/29/2023, 7:53 AM
I use koin for dependency injection, it makes it a lot easier and I inject the database to the repository.
This project of mine contains exactly what you need.
https://github.com/M0Coding/Pokedex
a
Adam Brown
03/29/2023, 9:50 AM
yup, that's the same thing I do.
a
adte
03/29/2023, 4:46 PM
@mohamed rejeb Thanks for sharing, that's a cool app!