The answer is probably "no", but just to be sure: ...
# announcements
d
The answer is probably "no", but just to be sure: Is there something like Java's
ServiceLoader
for pure Kotlin, i.e. can be used in a multiplatform project?
🚫 4
g
No, but it should be pretty easy to write own service locator for your code
d
Is there a pure-kotlin resource-access mechanism? Something like
Class.getResource
?
g
Resources is Java specific API
d
Yes, I know that. Question is, what would I do on the JS side?
g
Depends on your use case. There is no default js way to do that
d
Ok, that was my question, thanks.
g
Also js can be client and server side with different API set in each case
d
Yeah, I know. I was hoping Kotlin would provide something here to embed resources into final build artifact (.js file).
g
Nope. But you can provide them using expect/actual methods and implement on each platform. Depends on resource type. Probably you want to download it on client side and bundle to resources on server side
d
Yeah. I'll have to do some experiments. Thanks!