Add a non-pure function to a library and have a custom event pipe the data in:
Calling the custom event above would print the same random number thrice.
This should make it flexible, does not require an additional variable, can be used everywhere but may not play all that well with latent actions.