I’m not sure if anyone else has ever needed an ins...
# feed
c
I’m not sure if anyone else has ever needed an instance of
Random
that’s immutable, but here you go. https://gist.github.com/cjbrooks12/cbe7e515ecfd75d63ca68db42da3a41b
This is useful for programming with the MVI model, such as with #compose or when using the ballast MVI library. The default
Random
implementation is mutable internally, which can cause problems when your framework needs things to be immutable to work properly.
e
IMO keeping the
Random
interface is a mistake
c
There’s a lot of detail in the
Random
base class, plus a bunch of extension functions, that I didn’t want to copy. It could be confusing since it changes the behavior to be incompatible with the standard
Random
, but for my needs this is sufficient. And that’s why I just posted this as a gist rather than publishing it as a full library
a