andrea.santurbano
03/09/2021, 9:57 AMIR
).
The produced code seems not do depend to Kotlin as it contains internally all the required data structures and they’re not compatible with the Kotlin.js library
Can somebody help me or point to some useful resource that explain how to use kotlin-to-js compiled code into pure js applications?Big Chungus
03/09/2021, 1:25 PMandrea.santurbano
03/09/2021, 1:43 PMandrea.santurbano
03/09/2021, 1:44 PMandrea.santurbano
03/09/2021, 1:44 PMBig Chungus
03/09/2021, 1:44 PMBig Chungus
03/09/2021, 1:45 PMpublic val ...
will not be visible to JS if you don;t annotate that with @JsExportBig Chungus
03/09/2021, 1:46 PMandrea.santurbano
03/09/2021, 1:49 PMinterface IngestionStrategy<KEY, VALUE, EVT> {
fun mergeNodeEvents(events: Collection<Entity<KEY, VALUE>>): IngestionEvent<EVT>
fun deleteNodeEvents(events: Collection<Entity<KEY, VALUE>>): IngestionEvent<EVT>
fun mergeRelationshipEvents(events: Collection<Entity<KEY, VALUE>>): IngestionEvent<EVT>
fun deleteRelationshipEvents(events: Collection<Entity<KEY, VALUE>>): IngestionEvent<EVT>
}
And the class is annotated with @JsExport
why the argument (in my case Collection
because I exported Entity
) is not exported as well?andrea.santurbano
03/09/2021, 1:50 PMandrea.santurbano
03/09/2021, 1:51 PMBig Chungus
03/09/2021, 1:56 PMBig Chungus
03/09/2021, 1:56 PMBig Chungus
03/09/2021, 1:57 PMfunction mergeNodeEvents(events)
There are no types nor generics in js worldBig Chungus
03/09/2021, 1:57 PMandrea.santurbano
03/09/2021, 1:58 PMandrea.santurbano
03/09/2021, 1:58 PMandrea.santurbano
03/09/2021, 1:59 PMandrea.santurbano
03/09/2021, 1:59 PMBig Chungus
03/09/2021, 2:00 PMandrea.santurbano
03/09/2021, 2:00 PMandrea.santurbano
03/09/2021, 2:00 PMBig Chungus
03/09/2021, 2:01 PMandrea.santurbano
03/09/2021, 2:01 PMBig Chungus
03/09/2021, 2:01 PMBig Chungus
03/09/2021, 2:02 PMnew IngestionStrategy().mergeNodeEvents(1, "not expected type, but string", null, [])
Big Chungus
03/09/2021, 2:03 PMBig Chungus
03/09/2021, 2:03 PMnew IngestionStrategy().mergeNodeEvents([new Entity(), new Entity()])
Just be sure to export Entity as well if it's a classandrea.santurbano
03/09/2021, 2:04 PMEntity
is exportedandrea.santurbano
03/09/2021, 2:06 PMgraph-integration.js
the representation of Collection
exists in a js way, all the classes that implements collections have the same method namesandrea.santurbano
03/09/2021, 2:06 PMArrayList
are not exportedBig Chungus
03/09/2021, 2:14 PMandrea.santurbano
03/09/2021, 2:17 PMandrea.santurbano
03/09/2021, 2:17 PM