Hi, I have a project where I re-typed an entire Ty...
# javascript
a
Hi, I have a project where I re-typed an entire TypeScript library to Kotlin/JS, but it's not executing the side-effects, like this :
Copy code
import {Something} from './file';
import {Else} from './other';

Something.execute(Else.thing);

export {Something};
In my case the code
Something.execute(Else.thing)
will not be executed, and so it's making the library not working unless I execute this code by hand in Kotlin, is there a way to fix this ?
g
What's the implementation of
execute
in the Kotlin side ?
a
Just a static method, in my case it's this :
Copy code
companion object {
	fun registerPlugin(plugin: IApplicationPlugin)
}
And the code not executed is for example (there are a lot) this
b
Copy code
external fun require(module: dynamic): dynamic

fun main() {
  require("js/module/with/side/effects")
}
a
Like this ?
Copy code
fun main() {
    require("js/node_modules/@pixi/app")
}
Or do I have to put the filename also ?
b
No, llike this
Copy code
fun main() {
    require("@pixi/app")
}
Same as you'd
require('@pixi/app')
or
import * as Shit from '@pixi/app'
in js/ts
a
oh okay I see, I'll try then
it works, thanks !!
👍 3