https://kotlinlang.org logo
Title
d

Deepak k.k

05/18/2023, 9:21 AM
Hi All, In my KMM application I am using datastore and its working smoothly, but now I want to add the support for web as well. As of now data store not supporting in web(JS). Could you help me to solve, How can I by-pass the dependency based on my target. https://medium.com/@code_wizard/kmm-preferences-datastore-674382443262
j

Jeff Lockhart

05/18/2023, 3:08 PM
You can create an intermediate source set shared by your non-JS targets and add the dependency there. You could then create an interface that is implemented by the JS and non-JS platforms utilizing different dependencies. https://kotlinlang.org/docs/multiplatform-share-on-platforms.html https://kotlinlang.org/docs/multiplatform-hierarchy.html