Hey! If i create a KMP project with targets: - :ip...
# multiplatform
m
Hey! If i create a KMP project with targets: • 📱 android/ios • 🖥️ desktop • 🌐 web Do we already have the following tools available for all targets? • dependency injection (does koin work on all targets?) • database (does room work on web?) • networking (does ktor work on web?)
👍 1
p
DI(koin, kotlin-inject, anvil) and networking yes. Database no. You can abstract the DB layer and have a special implementation for the web using existing local persistence APIs. ~I am not even sure if the concept of a local database exists for the browser~(Update: IndexDB is the API for local databases in browsers). It is more common to just use the js local persistence APIs to cache data and so. But not a real local database
g
sqldelight is being worked on to support wasmJS
☝️ 3
🎉 1
m
@Pablichjenkov Wouldn’t you call this https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API a “concept of a local database”? (I’d like to see an example though of how to use that in Compose/wasmJs 😉)
p
Oh 😮 you right, I completely ignored IndexDB. Thanks for reminding me.
p
koin wasm can be used but is in Beta
b
Hello guys, I am new to KMP, and I am trying to build a project with these targets, android/iOS, desktop and web, I am using ktor for networking, it worked for both android and desktop but when I try to get the data in web it shows me "fail to fetch"
🖼️ 1
m
Maybe a CORS-problem? Without any details about the error it’s difficult to tell.