Just finished the 6th draft for my first kotlin li...
# feed
x
Just finished the 6th draft for my first kotlin library. 😵😵‍💫 https://github.com/x12q/randomizer
c
Which platforms are supported?
Does it use
kotlin.Random
internally? Can I specify a
Random
instance to a
random<T>()
call?
Ah, it depends on Dagger, so there's probably no chance of making it multiplatform :/
x
@CLOVIS Hi, I intend to support jvm first because I am unsure about the reflection capability of other platforms. This lib uses reflection a lot. Dagger does not really play a major role in the library, so it can be removed and replaced rather easily. I will replace it with something else (or I will just wire things up manually, probably 10 lines of code max) if it is feasible to run reflection on multiplatform. The library indeed uses
kotlin.Random
internally, and you can provide a Random instance to the
random
function like this :
random<YourClass>(random = YourRandom)
c
If it's reflection-heavy, it probably won't work well on other platforms
If you ever find a way to make it work on MPP, notify me and I'll add compat to https://gitlab.com/opensavvy/groundwork/prepared
x
Ok 👍