I am working on a library for technical indicators and am wondering if it is possible to compile the same library code for JS and JVM. This would allow me to have a single code base that could run in the browser as well as server side. Some googling has led me to believe that this is not possible but I wanted to confirm.
b
Big Chungus
02/11/2021, 3:52 PM
Absolutely, that's what kmp is for! You'll need to forego java ir js apis (or introduce expect/actual declarations for them)
@Big Chungus Thank you for the pointer. I found this as well https://github.com/svok/kotlin-multiplatform-sample/tree/master/proj-common/src. I am trying it out now but so far it looks promising. The next goal will be to see if I can incorporate the generated js code into an existing project but I don't think that will be difficult.