Question, can I share stuff between `JS`/`wasmJs`/...
# webassembly
e
Question, can I share stuff between `JS`/`wasmJs`/`wasmWasi`, or is
wasmWasi
a totally different target?
s
Of course you can.
commonMain
😄
😆 1
s
What do you mean by “share stuff”?
e
@Svyatoslav Kuzmich [JB] for example, for
JS
and
wasmJs
I have created a
jsAndWasmSharedMain
source set, so I can share functions and types that interact with JS.
But yeah as far as I understand WASI isn't meant to have JS interop, so no need for that.
s
You should be able to declare common source-sets and depend on them in
JS
,
wasmJs
and
wasmWasi
. See the example of this atomicfu library. This should work similar to other platforms.
😍 1
gratitude thank you 1